summaryrefslogtreecommitdiff
path: root/tests/regressiontests/templates/tests.py
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2010-02-21 23:38:33 +0000
committerJannis Leidel <jannis@leidel.info>2010-02-21 23:38:33 +0000
commit6cafd4b21f89523410c7d4c34740884c6a3552d8 (patch)
tree103ae6223eb6f2c1d42199629ab7f9c76d85061d /tests/regressiontests/templates/tests.py
parent373be1ec1fb06974c29790d732180c395f98c28e (diff)
Fixed #7876 - Improved template error message to include expected end tag. Thanks to Matthias Kestenholz for the initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12460 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/templates/tests.py')
-rw-r--r--tests/regressiontests/templates/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 88afc548dc..b2ba9f6f90 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -181,6 +181,14 @@ class Templates(unittest.TestCase):
settings.SETTINGS_MODULE = old_settings_module
settings.TEMPLATE_DEBUG = old_template_debug
+ def test_invalid_block_suggestion(self):
+ # See #7876
+ from django.template import Template, TemplateSyntaxError
+ try:
+ t = Template("{% if 1 %}lala{% endblock %}{% endif %}")
+ except TemplateSyntaxError, e:
+ self.assertEquals(e.args[0], "Invalid block tag: 'endblock', expected 'else' or 'endif'")
+
def test_templates(self):
template_tests = self.get_template_tests()
filter_tests = filters.get_filter_tests()