summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/views/templates/technical_404.html2
-rw-r--r--tests/view_tests/tests/test_debug.py10
2 files changed, 11 insertions, 1 deletions
diff --git a/django/views/templates/technical_404.html b/django/views/templates/technical_404.html
index aeba2daf9c..c47dae22af 100644
--- a/django/views/templates/technical_404.html
+++ b/django/views/templates/technical_404.html
@@ -26,7 +26,7 @@
<body>
<div id="summary">
<h1>Page not found <span>(404)</span></h1>
- {% if reason %}<pre class="exception_value">{{ reason }}</pre>{% endif %}
+ {% if reason and resolved %}<pre class="exception_value">{{ reason }}</pre>{% endif %}
<table class="meta">
<tr>
<th>Request Method:</th>
diff --git a/tests/view_tests/tests/test_debug.py b/tests/view_tests/tests/test_debug.py
index 28734434f3..9c85ed20fc 100644
--- a/tests/view_tests/tests/test_debug.py
+++ b/tests/view_tests/tests/test_debug.py
@@ -122,6 +122,11 @@ class DebugViewTests(SimpleTestCase):
def test_404(self):
response = self.client.get('/raises404/')
+ self.assertNotContains(
+ response,
+ '<pre class="exception_value">',
+ status_code=404,
+ )
self.assertContains(
response,
'<p>The current path, <code>not-in-urls</code>, didn’t match any '
@@ -133,6 +138,11 @@ class DebugViewTests(SimpleTestCase):
def test_404_not_in_urls(self):
response = self.client.get('/not-in-urls')
self.assertNotContains(response, "Raised by:", status_code=404)
+ self.assertNotContains(
+ response,
+ '<pre class="exception_value">',
+ status_code=404,
+ )
self.assertContains(response, "Django tried these URL patterns", status_code=404)
self.assertContains(
response,