Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed two failing i18n tests - they only failed when using ./runtests…

…, now they work both ways. And template tests give tracebacks when they fail.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1277 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3478fb51d6a1b7f27d2a6696c0e4b1f8b79fd9a8 1 parent 3bbc2bd
Georg Bauer authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 tests/othertests/templates.py
View
8 tests/othertests/templates.py
@@ -1,6 +1,8 @@
+import traceback
+
from django.core import template
from django.core.template import loader
-from django.utils.translation import activate, deactivate
+from django.utils.translation import activate, deactivate, install
# Helper objects for template tests
class SomeClass:
@@ -273,8 +275,11 @@ def run_tests(verbosity=0, standalone=False):
tests = TEMPLATE_TESTS.items()
tests.sort()
for name, vals in tests:
+ install()
if 'LANGUAGE_CODE' in vals[1]:
activate(vals[1]['LANGUAGE_CODE'])
+ else:
+ activate('en-us')
try:
output = loader.get_template(name).render(template.Context(vals[1]))
except Exception, e:
@@ -283,6 +288,7 @@ def run_tests(verbosity=0, standalone=False):
print "Template test: %s -- Passed" % name
else:
if verbosity:
+ traceback.print_exc()
print "Template test: %s -- FAILED. Got %s, exception: %s" % (name, e.__class__, e)
failed_tests.append(name)
continue
Please sign in to comment.
Something went wrong with that request. Please try again.