summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-12-09 16:17:56 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-12-09 16:18:52 +0100
commitd6bad2e9ea77ce48ee5755a7b44682d892bfa3d4 (patch)
tree4edec939d50712b5eafd8ea9e8199f5117eff45f /tests/regressiontests
parentfce779475e221e322a25dbf30dc25003e831afc2 (diff)
[1.5.x] Fixed #19392 -- Improved error for old-style url tags with dashes.
Thanks dloewenherz for the report. Backport of 4951932 from master.
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/templates/tests.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 9ec487d06c..d21434a12e 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -366,7 +366,7 @@ class Templates(TestCase):
with self.assertRaises(urlresolvers.NoReverseMatch):
t.render(c)
- def test_url_explicit_exception_for_old_syntax(self):
+ def test_url_explicit_exception_for_old_syntax_at_run_time(self):
# Regression test for #19280
t = Template('{% url path.to.view %}') # not quoted = old syntax
c = Context()
@@ -374,6 +374,12 @@ class Templates(TestCase):
"The syntax changed in Django 1.5, see the docs."):
t.render(c)
+ def test_url_explicit_exception_for_old_syntax_at_compile_time(self):
+ # Regression test for #19392
+ with self.assertRaisesRegexp(template.TemplateSyntaxError,
+ "The syntax of 'url' changed in Django 1.5, see the docs."):
+ t = Template('{% url my-view %}') # not a variable = old syntax
+
@override_settings(DEBUG=True, TEMPLATE_DEBUG=True)
def test_no_wrapped_exception(self):
"""