summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-11-24 22:04:17 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-11-24 22:10:51 +0100
commitd26691958443a4b968fecba5510c37768153fafa (patch)
tree6dfa97148d1beaff8c835c1063c5f777e52e38b1 /tests
parent690cac3a34321208c4601e37bd5166ee7133e5ef (diff)
Fixed #19280 -- Raised an explicit exception for the old {% url %} syntax.
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/templates/tests.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index 875035bc2e..6d55ebbc17 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -19,7 +19,8 @@ except ImportError: # Python 2
from urlparse import urljoin
from django import template
-from django.template import base as template_base, RequestContext, Template, Context
+from django.template import (base as template_base, Context, RequestContext,
+ Template, TemplateSyntaxError)
from django.core import urlresolvers
from django.template import loader
from django.template.loaders import app_directories, filesystem, cached
@@ -364,6 +365,14 @@ class Templates(TestCase):
with self.assertRaises(urlresolvers.NoReverseMatch):
t.render(c)
+ def test_url_explicit_exception_for_old_syntax(self):
+ # Regression test for #19280
+ t = Template('{% url path.to.view %}') # not quoted = old syntax
+ c = Context()
+ with self.assertRaisesRegexp(TemplateSyntaxError,
+ "The syntax changed in Django 1.5, see the docs."):
+ t.render(c)
+
@override_settings(DEBUG=True, TEMPLATE_DEBUG=True)
def test_no_wrapped_exception(self):
"""