summaryrefslogtreecommitdiff
path: root/tests/template_tests
diff options
context:
space:
mode:
authorinondle <qfulsher@gmail.com>2016-05-27 15:12:56 -0700
committerTim Graham <timograham@gmail.com>2016-05-27 18:12:56 -0400
commit93c312cc9cb17ec13ed1957c9a2d2e4ec56b09ed (patch)
treea22519bfa6661326d4c961e83211329dbfdaf0c3 /tests/template_tests
parentff6c6feae17120c2c7df74fb6a9dc76826a1e233 (diff)
Fixed #26573 -- Added descriptive error message for malformed if/else/elif template tags.
Diffstat (limited to 'tests/template_tests')
-rw-r--r--tests/template_tests/syntax_tests/test_if.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/template_tests/syntax_tests/test_if.py b/tests/template_tests/syntax_tests/test_if.py
index 703f3d352c..40593c7694 100644
--- a/tests/template_tests/syntax_tests/test_if.py
+++ b/tests/template_tests/syntax_tests/test_if.py
@@ -508,6 +508,12 @@ class IfTagTests(SimpleTestCase):
with self.assertRaises(TemplateSyntaxError):
self.engine.get_template('if-tag-error12')
+ @setup({'else-if-tag-error01': '{% if foo is bar %} yes {% else if foo is not bar %} no {% endif %}'})
+ def test_else_if_tag_error01(self):
+ error_message = 'Malformed template tag at line 1: "else if foo is not bar"'
+ with self.assertRaisesMessage(TemplateSyntaxError, error_message):
+ self.engine.get_template('else-if-tag-error01')
+
@setup({'if-tag-shortcircuit01': '{% if x.is_true or x.is_bad %}yes{% else %}no{% endif %}'})
def test_if_tag_shortcircuit01(self):
"""