summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLennart Regebro <regebro@gmail.com>2013-02-23 17:41:30 +0100
committerClaude Paroz <claude@2xlibre.net>2013-02-23 17:43:17 +0100
commit687d2e967dbc7c2ba29a90c74becc539d3ac2b9d (patch)
tree92b55514429d1e998bcc9e920db848c9e9578765 /tests
parent0ad76843b5032af52022adff7b676db633ce8b7e (diff)
Fixed #19827 -- Kept stacktrace in defaulttags exception reraising
Thanks Kronuz for the report and the initial patch.
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/templates/tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py
index b4dc983cf2..21b7827108 100644
--- a/tests/regressiontests/templates/tests.py
+++ b/tests/regressiontests/templates/tests.py
@@ -372,6 +372,22 @@ class Templates(TestCase):
with self.assertRaises(urlresolvers.NoReverseMatch):
t.render(c)
+ @override_settings(TEMPLATE_STRING_IF_INVALID='%s is invalid', SETTINGS_MODULE='also_something')
+ def test_url_reverse_view_name(self):
+ # Regression test for #19827
+ t = Template('{% url will_not_match %}')
+ c = Context()
+ try:
+ t.render(c)
+ except urlresolvers.NoReverseMatch:
+ tb = sys.exc_info()[2]
+ depth = 0
+ while tb.tb_next is not None:
+ tb = tb.tb_next
+ depth += 1
+ self.assertTrue(depth > 5,
+ "The traceback context was lost when reraising the traceback. See #19827")
+
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