forked from cdleary/coffin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not override globals provided by extensions.
Fixes #26, closes #27.
- Loading branch information
Showing
3 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
from os import path | ||
import sys | ||
|
||
def setup_package(): | ||
# setup Django with our test demo project | ||
sys.path.insert(0, path.join(path.dirname(__file__), 'res', 'apps')) | ||
from django.core.management import setup_environ | ||
import settings | ||
setup_environ(settings) | ||
# Setup Django with our test demo project. We need to do this in global | ||
# module code rather than setup_package(), because we want it to run | ||
# before any module-wide imports in any of the test modules. | ||
sys.path.insert(0, path.join(path.dirname(__file__), 'res', 'apps')) | ||
from django.core.management import setup_environ | ||
import settings | ||
setup_environ(settings) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"""Test construction of the implicitly provided JinjaEnvironment, | ||
in the common.py module. | ||
""" | ||
|
||
from coffin.common import get_env | ||
from django.test.utils import override_settings | ||
|
||
|
||
def test_i18n(): | ||
with override_settings(USE_I18N=True): | ||
assert get_env().from_string('{{ _("test") }}').render() == 'test' |