diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2016-07-22 17:38:35 -0700 |
|---|---|---|
| committer | Markus Holtermann <info@markusholtermann.eu> | 2016-07-24 18:29:01 +0200 |
| commit | caec27f87c56442d4512cb6dd9e6c26fd8d4414a (patch) | |
| tree | c1e58f3eb690eda55d656490e8aab59ba6a4441b | |
| parent | 1152c9b7954ede3b60dc6cbad6565ba21c4d7e96 (diff) | |
[1.9.x] Fixed #26938 -- Fixed invalid HTML in template postmortem on the debug page.
Backport of 348cfccd9072f0e08ffe4cfb3946d1dc6a629e86 from master
| -rw-r--r-- | django/views/debug.py | 1 | ||||
| -rw-r--r-- | docs/releases/1.9.9.txt | 3 | ||||
| -rw-r--r-- | tests/view_tests/tests/test_debug.py | 8 |
3 files changed, 10 insertions, 2 deletions
diff --git a/django/views/debug.py b/django/views/debug.py index 2629d345eb..a34962dce8 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -721,7 +721,6 @@ TECHNICAL_500_TEMPLATE = (""" {% for attempt in entry.tried %} <li><code>{{ attempt.0.loader_name }}</code>: {{ attempt.0.name }} ({{ attempt.1 }})</li> {% endfor %} - </ul> {% else %} <li>This engine did not provide a list of tried templates.</li> {% endif %} diff --git a/docs/releases/1.9.9.txt b/docs/releases/1.9.9.txt index c458f9611a..8e90f6c8dd 100644 --- a/docs/releases/1.9.9.txt +++ b/docs/releases/1.9.9.txt @@ -9,4 +9,5 @@ Django 1.9.9 fixes several bugs in 1.9.8. Bugfixes ======== -* ... +* Fixed invalid HTML in template postmortem on the debug page + (:ticket:`26938`). diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py index 03554f00eb..714652f8b1 100644 --- a/tests/view_tests/tests/test_debug.py +++ b/tests/view_tests/tests/test_debug.py @@ -159,6 +159,14 @@ class DebugViewTests(LoggingCaptureMixin, SimpleTestCase): }]): response = self.client.get(reverse('raises_template_does_not_exist', kwargs={"path": template_name})) self.assertContains(response, "%s (Source does not exist)" % template_path, status_code=500, count=2) + # Assert as HTML. + self.assertContains( + response, + '<li><code>django.template.loaders.filesystem.Loader</code>: ' + '%s (Source does not exist)</li>' % os.path.join(tempdir, 'notfound.html'), + status_code=500, + html=True, + ) def test_no_template_source_loaders(self): """ |
