summaryrefslogtreecommitdiff
path: root/tests/template_tests
diff options
context:
space:
mode:
authoramureki <fly.amureki@gmail.com>2016-04-03 10:02:20 +0200
committerTim Graham <timograham@gmail.com>2016-04-09 09:31:05 -0400
commitf8bbba80607435c68f34207bc1e9a133a3f9ffee (patch)
tree2407bbe9e650faafb187d4f632caa404b0adeb47 /tests/template_tests
parentc12a00e554c8b4b93931b520bb94a479c5ba8706 (diff)
Fixed #26403 -- Removed translated content in "Invalid block tag" message.
Diffstat (limited to 'tests/template_tests')
-rw-r--r--tests/template_tests/tests.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py
index 51dc9f248b..d555247f4b 100644
--- a/tests/template_tests/tests.py
+++ b/tests/template_tests/tests.py
@@ -8,6 +8,7 @@ from django.template import Context, Engine, TemplateSyntaxError
from django.template.base import UNKNOWN_SOURCE
from django.test import SimpleTestCase, override_settings
from django.urls import NoReverseMatch
+from django.utils import translation
class TemplateTests(SimpleTestCase):
@@ -64,15 +65,17 @@ class TemplateTests(SimpleTestCase):
def test_invalid_block_suggestion(self):
"""
- #7876 -- Error messages should include the unexpected block name.
+ Error messages should include the unexpected block name and be in all
+ English.
"""
engine = Engine()
msg = (
"Invalid block tag on line 1: 'endblock', expected 'elif', 'else' "
"or 'endif'. Did you forget to register or load this tag?"
)
- with self.assertRaisesMessage(TemplateSyntaxError, msg):
- engine.from_string("{% if 1 %}lala{% endblock %}{% endif %}")
+ with self.settings(USE_I18N=True), translation.override('de'):
+ with self.assertRaisesMessage(TemplateSyntaxError, msg):
+ engine.from_string("{% if 1 %}lala{% endblock %}{% endif %}")
def test_unknown_block_tag(self):
engine = Engine()