diff --git a/django/template/base.py b/django/template/base.py
index 0a2b2c9..cfa9f38 100644
a
|
b
|
from inspect import getargspec
|
7 | 7 | from django.conf import settings |
8 | 8 | from django.template.context import (Context, RequestContext, |
9 | 9 | ContextPopException) |
| 10 | from django.core.urlresolvers import NoReverseMatch |
10 | 11 | from django.utils.importlib import import_module |
11 | 12 | from django.utils.itercompat import is_iterable |
12 | 13 | from django.utils.text import (smart_split, unescape_string_literal, |
… |
… |
class Variable(object):
|
781 | 782 | # GOTCHA: This will also catch any TypeError |
782 | 783 | # raised in the function itself. |
783 | 784 | current = settings.TEMPLATE_STRING_IF_INVALID # invalid method call |
| 785 | except NoReverseMatch, e: |
| 786 | raise e |
784 | 787 | except Exception as e: |
785 | 788 | if getattr(e, 'silent_variable_failure', False): |
786 | 789 | current = settings.TEMPLATE_STRING_IF_INVALID |
diff --git a/tests/regressiontests/templates/response.py b/tests/regressiontests/templates/response.py
index 93919b9..737adc9 100644
a
|
b
|
from datetime import datetime
|
7 | 7 | |
8 | 8 | from django.test import RequestFactory, TestCase |
9 | 9 | from django.conf import settings |
| 10 | from django.core.urlresolvers import NoReverseMatch |
10 | 11 | from django.template import Template, Context |
11 | 12 | from django.template.response import (TemplateResponse, SimpleTemplateResponse, |
12 | 13 | ContentNotRenderedError) |
… |
… |
class TemplateResponseTest(TestCase):
|
206 | 207 | response = self._response('{{ foo }}{{ processors }}').render() |
207 | 208 | self.assertEqual(response.content, b'yes') |
208 | 209 | |
| 210 | def test_included_error_template(self): |
| 211 | """ |
| 212 | Test behavior of the raise errors into included blocks. |
| 213 | See #18169 |
| 214 | """ |
| 215 | load_name = 'included_content.html' |
| 216 | tmpl = TemplateResponse(self.factory.get('/'), load_name, {}) |
| 217 | self.assertRaises(NoReverseMatch, tmpl.render) |
| 218 | |
209 | 219 | def test_render_with_requestcontext(self): |
210 | 220 | response = self._response('{{ foo }}{{ processors }}', |
211 | 221 | {'foo': 'bar'}).render() |
diff --git a/tests/regressiontests/templates/templates/included_base.html b/tests/regressiontests/templates/templates/included_base.html
new file mode 100644
index 0000000..eae222c
-
|
+
|
|
| 1 | {% block content %} |
| 2 | {% block error_here %}{% endblock %} |
| 3 | {% endblock %} |
diff --git a/tests/regressiontests/templates/templates/included_content.html b/tests/regressiontests/templates/templates/included_content.html
new file mode 100644
index 0000000..4945f72
-
|
+
|
|
| 1 | {% extends "included_base.html" %} |
| 2 | |
| 3 | {% block content %} |
| 4 | content |
| 5 | {{ block.super }} |
| 6 | {% endblock %} |
| 7 | |
| 8 | {% block error_here %} |
| 9 | error here |
| 10 | {% url non_existing_url %} |
| 11 | {% endblock %} |