1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

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
This commit is contained in:
Jannis Leidel
2010-02-21 23:38:33 +00:00
parent 373be1ec1f
commit 6cafd4b21f
2 changed files with 13 additions and 3 deletions

View File

@@ -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()