Django

Code

Changeset 1277

Show
Ignore:
Timestamp:
11/17/05 09:55:04 (3 years ago)
Author:
hugo
Message:

fixed two failing i18n tests - they only failed when using ./runtests, now they work both ways. And template tests give tracebacks when they fail.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/othertests/templates.py

    r1068 r1277  
     1import traceback 
     2 
    13from django.core import template 
    24from django.core.template import loader 
    3 from django.utils.translation import activate, deactivate 
     5from django.utils.translation import activate, deactivate, install 
    46 
    57# Helper objects for template tests 
     
    274276    tests.sort() 
    275277    for name, vals in tests: 
     278        install() 
    276279        if 'LANGUAGE_CODE' in vals[1]: 
    277280            activate(vals[1]['LANGUAGE_CODE']) 
     281        else: 
     282            activate('en-us') 
    278283        try: 
    279284            output = loader.get_template(name).render(template.Context(vals[1])) 
     
    284289            else: 
    285290                if verbosity: 
     291                    traceback.print_exc() 
    286292                    print "Template test: %s -- FAILED. Got %s, exception: %s" % (name, e.__class__, e) 
    287293                failed_tests.append(name)