summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGeorg Bauer <gb@hugo.westfalen.de>2005-10-14 21:33:45 +0000
committerGeorg Bauer <gb@hugo.westfalen.de>2005-10-14 21:33:45 +0000
commit2a2e2fb6aa7f46a7ada2a320c775a315045f8b83 (patch)
tree1c00ef17cc6d0f09b4559375705f3fba1e2887da /tests
parent2ffca1711ddd58ce0457bbf972a25402b746b73b (diff)
parent083b4f9001f3968138c4d0c34ab741cf7be97f43 (diff)
i18n: merged up to r868
git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@869 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/othertests/templates.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/othertests/templates.py b/tests/othertests/templates.py
index 9568b5886c..4ced220df5 100644
--- a/tests/othertests/templates.py
+++ b/tests/othertests/templates.py
@@ -1,4 +1,5 @@
-from django.core import template, template_loader
+from django.core import template
+from django.core.template import loader
from django.utils.translation import activate, deactivate
# Helper objects for template tests
@@ -259,7 +260,7 @@ TEMPLATE_TESTS = {
'i18n14': ('{{ bool|yesno:"ja,nein" }}', {'bool': True}, 'ja'),
}
-# This replaces the standard template_loader.
+# This replaces the standard template loader.
def test_template_loader(template_name, template_dirs=None):
try:
return TEMPLATE_TESTS[template_name][0]
@@ -267,7 +268,7 @@ def test_template_loader(template_name, template_dirs=None):
raise template.TemplateDoesNotExist, template_name
def run_tests(verbosity=0, standalone=False):
- template_loader.load_template_source, old_template_loader = test_template_loader, template_loader.load_template_source
+ loader.load_template_source, old_template_loader = test_template_loader, loader.load_template_source
failed_tests = []
tests = TEMPLATE_TESTS.items()
tests.sort()
@@ -275,7 +276,7 @@ def run_tests(verbosity=0, standalone=False):
if 'LANGUAGE_CODE' in vals[1]:
activate('*', vals[1]['LANGUAGE_CODE'])
try:
- output = template_loader.get_template(name).render(template.Context(vals[1]))
+ output = loader.get_template(name).render(template.Context(vals[1]))
except Exception, e:
if e.__class__ == vals[2]:
if verbosity:
@@ -294,7 +295,7 @@ def run_tests(verbosity=0, standalone=False):
if verbosity:
print "Template test: %s -- FAILED. Expected %r, got %r" % (name, vals[2], output)
failed_tests.append(name)
- template_loader.load_template_source = old_template_loader
+ loader.load_template_source = old_template_loader
if failed_tests and not standalone:
msg = "Template tests %s failed." % failed_tests