Ticket #13167: r12820_with_tests.diff
File r12820_with_tests.diff, 1.5 KB (added by , 15 years ago) |
---|
-
django/template/__init__.py
570 570 if not lookup: 571 571 arg_vals.append(mark_safe(arg)) 572 572 else: 573 arg_vals.append(arg.resolve(context)) 573 try: 574 arg_vals.append(arg.resolve(context)) 575 except VariableDoesNotExist: 576 arg_vals.append(settings.TEMPLATE_STRING_IF_INVALID) 574 577 if getattr(func, 'needs_autoescape', False): 575 578 new_obj = func(obj, autoescape=context.autoescape, *arg_vals) 576 579 else: -
tests/regressiontests/templates/tests.py
551 551 552 552 #filters should accept empty string constants 553 553 'filter-syntax20': ('{{ ""|default_if_none:"was none" }}', {}, ""), 554 555 # regression test for #13167 556 'filter-syntax21': ("{{ foo|default:notreal }}", {'foo': 'test'}, ('test', 'test')), 557 'filter-syntax22': ("{{ foo|default:notreal }}", {'foo': ''}, ('', 'INVALID')), 554 558 555 559 ### COMMENT SYNTAX ######################################################## 556 560 'comment-syntax01': ("{# this is hidden #}hello", {}, "hello"),