summaryrefslogtreecommitdiff
path: root/tests/template_tests/syntax_tests/test_basic.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template_tests/syntax_tests/test_basic.py')
-rw-r--r--tests/template_tests/syntax_tests/test_basic.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/template_tests/syntax_tests/test_basic.py b/tests/template_tests/syntax_tests/test_basic.py
index 741b3ace8f..b72d6e6414 100644
--- a/tests/template_tests/syntax_tests/test_basic.py
+++ b/tests/template_tests/syntax_tests/test_basic.py
@@ -311,3 +311,15 @@ class BasicSyntaxTests(SimpleTestCase):
"""
output = self.engine.render_to_string('basic-syntax38', {"var": {"callable": lambda: "foo bar"}})
self.assertEqual(output, 'foo bar')
+
+ @setup({'template': '{% block content %}'})
+ def test_unclosed_block(self):
+ msg = "Unclosed tag 'block'. Looking for one of: endblock."
+ with self.assertRaisesMessage(TemplateSyntaxError, msg):
+ self.engine.render_to_string('template')
+
+ @setup({'template': '{% if a %}'})
+ def test_unclosed_block2(self):
+ msg = "Unclosed tag 'if'. Looking for one of: elif, else, endif."
+ with self.assertRaisesMessage(TemplateSyntaxError, msg):
+ self.engine.render_to_string('template')