diff --git a/django/template/base.py b/django/template/base.py
index f43194d..c23685c 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):
|
| 788 | 789 | # GOTCHA: This will also catch any TypeError |
| 789 | 790 | # raised in the function itself. |
| 790 | 791 | current = settings.TEMPLATE_STRING_IF_INVALID # invalid method call |
| | 792 | except NoReverseMatch: |
| | 793 | raise |
| 791 | 794 | except Exception as e: |
| 792 | 795 | if getattr(e, 'silent_variable_failure', False): |
| 793 | 796 | current = settings.TEMPLATE_STRING_IF_INVALID |
diff --git a/tests/regressiontests/templates/response.py b/tests/regressiontests/templates/response.py
index c4da50a..51a5692 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):
|
| 222 | 223 | response = self._response('{{ foo }}{{ processors }}').render() |
| 223 | 224 | self.assertEqual(response.content, b'yes') |
| 224 | 225 | |
| | 226 | def test_included_error_template(self): |
| | 227 | """ |
| | 228 | Test behavior of the raise errors into included blocks. |
| | 229 | See #18169 |
| | 230 | """ |
| | 231 | load_name = 'included_content.html' |
| | 232 | tmpl = TemplateResponse(self.factory.get('/'), load_name, {}) |
| | 233 | self.assertRaises(NoReverseMatch, tmpl.render) |
| | 234 | |
| 225 | 235 | def test_render_with_requestcontext(self): |
| 226 | 236 | response = self._response('{{ foo }}{{ processors }}', |
| 227 | 237 | {'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 %} |