Code

Ticket #13167: 13167_test.diff

File 13167_test.diff, 1.0 KB (added by kmtracey, 4 years ago)
Line 
1ndex: tests/regressiontests/templates/tests.py
2===================================================================
3--- tests/regressiontests/templates/tests.py    (revision 12841)
4+++ tests/regressiontests/templates/tests.py    (working copy)
5@@ -778,6 +778,12 @@
6             'if-tag-error11': ("{% if 1 == %}yes{% endif %}", {}, template.TemplateSyntaxError),
7             'if-tag-error12': ("{% if a not b %}yes{% endif %}", {}, template.TemplateSyntaxError),
8
9+            # Non-existent args
10+            'if-tag-badarg01':("{% if x|default_if_none:y %}yes{% endif %}", {}, ''),
11+            'if-tag-badarg02':("{% if x|default_if_none:y %}yes{% endif %}", {'y': 0}, ''),
12+            'if-tag-badarg03':("{% if x|default_if_none:y %}yes{% endif %}", {'y': 1}, 'yes'),
13+            'if-tag-badarg04':("{% if x|default_if_none:y %}yes{% else %}no{% endif %}", {}, 'no'),
14+
15             # Additional, more precise parsing tests are in SmartIfTests
16
17             ### IFCHANGED TAG #########################################################