Refs 32637 -- Made technical 404 debug page display exception message when URL is resolved.
Follow up to 3b8527e32b
.
This commit is contained in:
parent
eab71f7690
commit
d68be0494b
|
@ -26,7 +26,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="summary">
|
<div id="summary">
|
||||||
<h1>Page not found <span>(404)</span></h1>
|
<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">
|
<table class="meta">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Request Method:</th>
|
<th>Request Method:</th>
|
||||||
|
|
|
@ -122,6 +122,11 @@ class DebugViewTests(SimpleTestCase):
|
||||||
|
|
||||||
def test_404(self):
|
def test_404(self):
|
||||||
response = self.client.get('/raises404/')
|
response = self.client.get('/raises404/')
|
||||||
|
self.assertNotContains(
|
||||||
|
response,
|
||||||
|
'<pre class="exception_value">',
|
||||||
|
status_code=404,
|
||||||
|
)
|
||||||
self.assertContains(
|
self.assertContains(
|
||||||
response,
|
response,
|
||||||
'<p>The current path, <code>not-in-urls</code>, didn’t match any '
|
'<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):
|
def test_404_not_in_urls(self):
|
||||||
response = self.client.get('/not-in-urls')
|
response = self.client.get('/not-in-urls')
|
||||||
self.assertNotContains(response, "Raised by:", status_code=404)
|
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, "Django tried these URL patterns", status_code=404)
|
||||||
self.assertContains(
|
self.assertContains(
|
||||||
response,
|
response,
|
||||||
|
|
Loading…
Reference in New Issue