diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 35d0122..626b32f 100644
a
|
b
|
class Templates(unittest.TestCase):
|
754 | 754 | 'cycle23': ("{% for x in values %}{% cycle 'a' 'b' 'c' as abc silent %}{{ abc }}{{ x }}{% endfor %}", {'values': [1,2,3,4]}, "a1b2c3a4"), |
755 | 755 | 'included-cycle': ('{{ abc }}', {'abc': 'xxx'}, 'xxx'), |
756 | 756 | 'cycle24': ("{% for x in values %}{% cycle 'a' 'b' 'c' as abc silent %}{% include 'included-cycle' %}{% endfor %}", {'values': [1,2,3,4]}, "abca"), |
| 757 | 'cycle24': ("{% for x in values %}{% cycle a b|default:'empty' %}{% endfor %}", {'values': [1,2]}, "empty"), |
757 | 758 | |
758 | 759 | ### EXCEPTIONS ############################################################ |
759 | 760 | |
… |
… |
class Templates(unittest.TestCase):
|
1470 | 1471 | 'legacywith02': ('{{ key }}{% with dict.key as key %}{{ key }}-{{ dict.key }}-{{ key }}{% endwith %}{{ key }}', {'dict': {'key': 50}}, ('50-50-50', 'INVALID50-50-50INVALID')), |
1471 | 1472 | |
1472 | 1473 | 'with03': ('{% with a=alpha b=beta %}{{ a }}{{ b }}{% endwith %}', {'alpha': 'A', 'beta': 'B'}, 'AB'), |
| 1474 | 'with04': ('{% with const="constant" %}{{ const }}{% endwith %}', {}, 'constant'), |
| 1475 | |
| 1476 | # don't change semantics by using the with tag |
| 1477 | 'with05': ('{{ a }}{% if a == "" %}A{% endif %}{% with b=a %}{{ b }}{% if b == "" %}b{% endif %}{% endwith %}', {}, ('', 'INVALIDINVALID')), |
| 1478 | 'with06': ('{{ a }}{% if a == "" %}A{% endif %}{% with b=a|default:"" %}{{ b }}{% if b == "" %}b{% endif %}{% endwith %}', {}, ('b', 'INVALIDb')), |
1473 | 1479 | |
1474 | 1480 | 'with-error01': ('{% with dict.key xx key %}{{ key }}{% endwith %}', {'dict': {'key': 50}}, template.TemplateSyntaxError), |
1475 | 1481 | 'with-error02': ('{% with dict.key as %}{{ key }}{% endwith %}', {'dict': {'key': 50}}, template.TemplateSyntaxError), |