summaryrefslogtreecommitdiff
path: root/tests/regressiontests/templates
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-04-12 13:56:38 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-04-12 13:56:38 +0000
commit2cebe4395e9ed345bbbe346b91842b4c97ffcfc7 (patch)
tree8afe1fe4b568d431fe989d00a1e27a86c1d612f4 /tests/regressiontests/templates
parent55c31fbdefe3bc3c948599b66781e7a9a1dae2a2 (diff)
Refs #13167 -- Corrected a regression in the way non-existent variables are handled by {% if %} tags. Thanks to ohmi2 for pointing out the regression in 1.2, and Karen for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12954 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/templates')
-rw-r--r--tests/regressiontests/templates/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 93ffb4da67..372d2ab1c2 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -782,6 +782,12 @@ class Templates(unittest.TestCase):
'if-tag-error11': ("{% if 1 == %}yes{% endif %}", {}, template.TemplateSyntaxError),
'if-tag-error12': ("{% if a not b %}yes{% endif %}", {}, template.TemplateSyntaxError),
+ # Non-existent args
+ 'if-tag-badarg01':("{% if x|default_if_none:y %}yes{% endif %}", {}, ''),
+ 'if-tag-badarg02':("{% if x|default_if_none:y %}yes{% endif %}", {'y': 0}, ''),
+ 'if-tag-badarg03':("{% if x|default_if_none:y %}yes{% endif %}", {'y': 1}, 'yes'),
+ 'if-tag-badarg04':("{% if x|default_if_none:y %}yes{% else %}no{% endif %}", {}, 'no'),
+
# Additional, more precise parsing tests are in SmartIfTests
### IFCHANGED TAG #########################################################