Fixed #26938 -- Fixed invalid HTML in template postmortem on the debug page.

This commit is contained in:
Jon Dufresne 2016-07-22 17:38:35 -07:00 committed by Markus Holtermann
parent b2e54aec58
commit 348cfccd90
No known key found for this signature in database
GPG Key ID: AFE79D68D41C7E39
3 changed files with 10 additions and 2 deletions

View File

@ -726,7 +726,6 @@ TECHNICAL_500_TEMPLATE = ("""
{% for attempt in entry.tried %} {% for attempt in entry.tried %}
<li><code>{{ attempt.0.loader_name }}</code>: {{ attempt.0.name }} ({{ attempt.1 }})</li> <li><code>{{ attempt.0.loader_name }}</code>: {{ attempt.0.name }} ({{ attempt.1 }})</li>
{% endfor %} {% endfor %}
</ul>
{% else %} {% else %}
<li>This engine did not provide a list of tried templates.</li> <li>This engine did not provide a list of tried templates.</li>
{% endif %} {% endif %}

View File

@ -9,4 +9,5 @@ Django 1.9.9 fixes several bugs in 1.9.8.
Bugfixes Bugfixes
======== ========
* ... * Fixed invalid HTML in template postmortem on the debug page
(:ticket:`26938`).

View File

@ -169,6 +169,14 @@ class DebugViewTests(LoggingCaptureMixin, SimpleTestCase):
}]): }]):
response = self.client.get(reverse('raises_template_does_not_exist', kwargs={"path": template_name})) 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) 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): def test_no_template_source_loaders(self):
""" """