Fixed #35143 -- Improved accessibility of 404/500 debug pages.

This:
- changes the header, main, and footer content areas to be rendered
  in a <header>, <main>, and <footer> tags,
- adds scope attributes to <th>,
- uses <code> for a patterns list,
- uses <small> instead of <span>.
This commit is contained in:
Marijke Luttekes 2024-01-28 13:51:34 +01:00 committed by Mariusz Felisiak
parent c317e81378
commit b9e2a3fc63
5 changed files with 100 additions and 76 deletions

View File

@ -638,6 +638,7 @@ answer newbie questions, and generally made Django that much better:
Marc Tamlyn <marc.tamlyn@gmail.com> Marc Tamlyn <marc.tamlyn@gmail.com>
Marc-Aurèle Brothier <ma.brothier@gmail.com> Marc-Aurèle Brothier <ma.brothier@gmail.com>
Marian Andre <django@andre.sk> Marian Andre <django@andre.sk>
Marijke Luttekes <mail@marijkeluttekes.dev>
Marijn Vriens <marijn@metronomo.cl> Marijn Vriens <marijn@metronomo.cl>
Mario Gonzalez <gonzalemario@gmail.com> Mario Gonzalez <gonzalemario@gmail.com>
Mariusz Felisiak <felisiak.mariusz@gmail.com> Mariusz Felisiak <felisiak.mariusz@gmail.com>

View File

@ -9,9 +9,9 @@
body * { padding:10px 20px; } body * { padding:10px 20px; }
body * * { padding:0; } body * * { padding:0; }
body { font:small sans-serif; background:#eee; color:#000; } body { font:small sans-serif; background:#eee; color:#000; }
body>div { border-bottom:1px solid #ddd; } body > :where(header, main, footer) { border-bottom:1px solid #ddd; }
h1 { font-weight:normal; margin-bottom:.4em; } h1 { font-weight:normal; margin-bottom:.4em; }
h1 span { font-size:60%; color:#666; font-weight:normal; } h1 small { font-size:60%; color:#666; font-weight:normal; }
table { border:none; border-collapse: collapse; width:100%; } table { border:none; border-collapse: collapse; width:100%; }
td, th { vertical-align:top; padding:2px 3px; } td, th { vertical-align:top; padding:2px 3px; }
th { width:12em; text-align:right; color:#666; padding-right:.5em; } th { width:12em; text-align:right; color:#666; padding-right:.5em; }
@ -24,27 +24,28 @@
</style> </style>
</head> </head>
<body> <body>
<div id="summary"> <header id="summary">
<h1>Page not found <span>(404)</span></h1> <h1>Page not found <small>(404)</small></h1>
{% if reason and resolved %}<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 scope="row">Request Method:</th>
<td>{{ request.META.REQUEST_METHOD }}</td> <td>{{ request.META.REQUEST_METHOD }}</td>
</tr> </tr>
<tr> <tr>
<th>Request URL:</th> <th scope="row">Request URL:</th>
<td>{{ request.build_absolute_uri }}</td> <td>{{ request.build_absolute_uri }}</td>
</tr> </tr>
{% if raising_view_name %} {% if raising_view_name %}
<tr> <tr>
<th>Raised by:</th> <th scope="row">Raised by:</th>
<td>{{ raising_view_name }}</td> <td>{{ raising_view_name }}</td>
</tr> </tr>
{% endif %} {% endif %}
</table> </table>
</div> </header>
<div id="info">
<main id="info">
{% if urlpatterns %} {% if urlpatterns %}
<p> <p>
Using the URLconf defined in <code>{{ urlconf }}</code>, Using the URLconf defined in <code>{{ urlconf }}</code>,
@ -54,8 +55,10 @@
{% for pattern in urlpatterns %} {% for pattern in urlpatterns %}
<li> <li>
{% for pat in pattern %} {% for pat in pattern %}
<code>
{{ pat.pattern }} {{ pat.pattern }}
{% if forloop.last and pat.name %}[name='{{ pat.name }}']{% endif %} {% if forloop.last and pat.name %}[name='{{ pat.name }}']{% endif %}
</code>
{% endfor %} {% endfor %}
</li> </li>
{% endfor %} {% endfor %}
@ -69,14 +72,14 @@
{% if resolved %}matched the last one.{% else %}didnt match any of these.{% endif %} {% if resolved %}matched the last one.{% else %}didnt match any of these.{% endif %}
</p> </p>
{% endif %} {% endif %}
</div> </main>
<div id="explanation"> <footer id="explanation">
<p> <p>
Youre seeing this error because you have <code>DEBUG = True</code> in Youre seeing this error because you have <code>DEBUG = True</code> in
your Django settings file. Change that to <code>False</code>, and Django your Django settings file. Change that to <code>False</code>, and Django
will display a standard 404 page. will display a standard 404 page.
</p> </p>
</div> </footer>
</body> </body>
</html> </html>

View File

@ -10,7 +10,7 @@
body * { padding:10px 20px; } body * { padding:10px 20px; }
body * * { padding:0; } body * * { padding:0; }
body { font:small sans-serif; background-color:#fff; color:#000; } body { font:small sans-serif; background-color:#fff; color:#000; }
body>div { border-bottom:1px solid #ddd; } body > :where(header, main, footer) { border-bottom:1px solid #ddd; }
h1 { font-weight:normal; } h1 { font-weight:normal; }
h2 { margin-bottom:.8em; } h2 { margin-bottom:.8em; }
h3 { margin:1em 0 .5em 0; } h3 { margin:1em 0 .5em 0; }
@ -47,6 +47,8 @@
.user div.commands a { color: black; } .user div.commands a { color: black; }
#summary { background: #ffc; } #summary { background: #ffc; }
#summary h2 { font-weight: normal; color: #666; } #summary h2 { font-weight: normal; color: #666; }
#info { padding: 0; }
#info > * { padding:10px 20px; }
#explanation { background:#eee; } #explanation { background:#eee; }
#template, #template-not-exist { background:#f6f6f6; } #template, #template-not-exist { background:#f6f6f6; }
#template-not-exist ul { margin: 0 0 10px 20px; } #template-not-exist ul { margin: 0 0 10px 20px; }
@ -97,67 +99,69 @@
{% endif %} {% endif %}
</head> </head>
<body> <body>
<div id="summary"> <header id="summary">
<h1>{% if exception_type %}{{ exception_type }}{% else %}Report{% endif %} <h1>{% if exception_type %}{{ exception_type }}{% else %}Report{% endif %}
{% if request %} at {{ request.path_info }}{% endif %}</h1> {% if request %} at {{ request.path_info }}{% endif %}</h1>
<pre class="exception_value">{% if exception_value %}{{ exception_value|force_escape }}{% if exception_notes %}{{ exception_notes }}{% endif %}{% else %}No exception message supplied{% endif %}</pre> <pre class="exception_value">{% if exception_value %}{{ exception_value|force_escape }}{% if exception_notes %}{{ exception_notes }}{% endif %}{% else %}No exception message supplied{% endif %}</pre>
<table class="meta"> <table class="meta">
{% if request %} {% if request %}
<tr> <tr>
<th>Request Method:</th> <th scope="row">Request Method:</th>
<td>{{ request.META.REQUEST_METHOD }}</td> <td>{{ request.META.REQUEST_METHOD }}</td>
</tr> </tr>
<tr> <tr>
<th>Request URL:</th> <th scope="row">Request URL:</th>
<td>{{ request_insecure_uri }}</td> <td>{{ request_insecure_uri }}</td>
</tr> </tr>
{% endif %} {% endif %}
<tr> <tr>
<th>Django Version:</th> <th scope="row">Django Version:</th>
<td>{{ django_version_info }}</td> <td>{{ django_version_info }}</td>
</tr> </tr>
{% if exception_type %} {% if exception_type %}
<tr> <tr>
<th>Exception Type:</th> <th scope="row">Exception Type:</th>
<td>{{ exception_type }}</td> <td>{{ exception_type }}</td>
</tr> </tr>
{% endif %} {% endif %}
{% if exception_type and exception_value %} {% if exception_type and exception_value %}
<tr> <tr>
<th>Exception Value:</th> <th scope="row">Exception Value:</th>
<td><pre>{{ exception_value|force_escape }}</pre></td> <td><pre>{{ exception_value|force_escape }}</pre></td>
</tr> </tr>
{% endif %} {% endif %}
{% if lastframe %} {% if lastframe %}
<tr> <tr>
<th>Exception Location:</th> <th scope="row">Exception Location:</th>
<td><span class="fname">{{ lastframe.filename }}</span>, line {{ lastframe.lineno }}, in {{ lastframe.function }}</td> <td><span class="fname">{{ lastframe.filename }}</span>, line {{ lastframe.lineno }}, in {{ lastframe.function }}</td>
</tr> </tr>
{% endif %} {% endif %}
{% if raising_view_name %} {% if raising_view_name %}
<tr> <tr>
<th>Raised during:</th> <th scope="row">Raised during:</th>
<td>{{ raising_view_name }}</td> <td>{{ raising_view_name }}</td>
</tr> </tr>
{% endif %} {% endif %}
<tr> <tr>
<th>Python Executable:</th> <th scope="row">Python Executable:</th>
<td>{{ sys_executable }}</td> <td>{{ sys_executable }}</td>
</tr> </tr>
<tr> <tr>
<th>Python Version:</th> <th scope="row">Python Version:</th>
<td>{{ sys_version_info }}</td> <td>{{ sys_version_info }}</td>
</tr> </tr>
<tr> <tr>
<th>Python Path:</th> <th scope="row">Python Path:</th>
<td><pre>{{ sys_path|pprint }}</pre></td> <td><pre><code>{{ sys_path|pprint }}</code></pre></td>
</tr> </tr>
<tr> <tr>
<th>Server time:</th> <th scope="row">Server time:</th>
<td>{{server_time|date:"r"}}</td> <td>{{server_time|date:"r"}}</td>
</tr> </tr>
</table> </table>
</div> </header>
<main id="info">
{% if unicode_hint %} {% if unicode_hint %}
<div id="unicode-hint"> <div id="unicode-hint">
<h2>Unicode error hint</h2> <h2>Unicode error hint</h2>
@ -195,11 +199,11 @@
{% if template_info.bottom != template_info.total %} cut-bottom{% endif %}"> {% if template_info.bottom != template_info.total %} cut-bottom{% endif %}">
{% for source_line in template_info.source_lines %} {% for source_line in template_info.source_lines %}
{% if source_line.0 == template_info.line %} {% if source_line.0 == template_info.line %}
<tr class="error"><th>{{ source_line.0 }}</th> <tr class="error"><th scope="row">{{ source_line.0 }}</th>
<td>{{ template_info.before }}<span class="specific">{{ template_info.during }}</span>{{ template_info.after }}</td> <td>{{ template_info.before }}<span class="specific">{{ template_info.during }}</span>{{ template_info.after }}</td>
</tr> </tr>
{% else %} {% else %}
<tr><th>{{ source_line.0 }}</th> <tr><th scope="row">{{ source_line.0 }}</th>
<td>{{ source_line.1 }}</td></tr> <td>{{ source_line.1 }}</td></tr>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@ -266,8 +270,8 @@
<table class="vars" id="v{{ frame.id }}"> <table class="vars" id="v{{ frame.id }}">
<thead> <thead>
<tr> <tr>
<th>Variable</th> <th scope="col">Variable</th>
<th>Value</th> <th scope="col">Value</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -354,8 +358,8 @@ Exception Value: {{ exception_value|force_escape }}{% if exception_notes %}{{ ex
<table class="req"> <table class="req">
<thead> <thead>
<tr> <tr>
<th>Variable</th> <th scope="col">Variable</th>
<th>Value</th> <th scope="col">Value</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -376,8 +380,8 @@ Exception Value: {{ exception_value|force_escape }}{% if exception_notes %}{{ ex
<table class="req"> <table class="req">
<thead> <thead>
<tr> <tr>
<th>Variable</th> <th scope="col">Variable</th>
<th>Value</th> <th scope="col">Value</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -398,8 +402,8 @@ Exception Value: {{ exception_value|force_escape }}{% if exception_notes %}{{ ex
<table class="req"> <table class="req">
<thead> <thead>
<tr> <tr>
<th>Variable</th> <th scope="col">Variable</th>
<th>Value</th> <th scope="col">Value</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -420,8 +424,8 @@ Exception Value: {{ exception_value|force_escape }}{% if exception_notes %}{{ ex
<table class="req"> <table class="req">
<thead> <thead>
<tr> <tr>
<th>Variable</th> <th scope="col">Variable</th>
<th>Value</th> <th scope="col">Value</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -441,8 +445,8 @@ Exception Value: {{ exception_value|force_escape }}{% if exception_notes %}{{ ex
<table class="req"> <table class="req">
<thead> <thead>
<tr> <tr>
<th>Variable</th> <th scope="col">Variable</th>
<th>Value</th> <th scope="col">Value</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -463,8 +467,8 @@ Exception Value: {{ exception_value|force_escape }}{% if exception_notes %}{{ ex
<table class="req"> <table class="req">
<thead> <thead>
<tr> <tr>
<th>Setting</th> <th scope="col">Setting</th>
<th>Value</th> <th scope="col">Value</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -478,14 +482,16 @@ Exception Value: {{ exception_value|force_escape }}{% if exception_notes %}{{ ex
</table> </table>
</div> </div>
</main>
{% if not is_email %} {% if not is_email %}
<div id="explanation"> <footer id="explanation">
<p> <p>
Youre seeing this error because you have <code>DEBUG = True</code> in your Youre seeing this error because you have <code>DEBUG = True</code> in your
Django settings file. Change that to <code>False</code>, and Django will Django settings file. Change that to <code>False</code>, and Django will
display a standard page generated by the handler for this status code. display a standard page generated by the handler for this status code.
</p> </p>
</div> </footer>
{% endif %} {% endif %}
</body> </body>
</html> </html>

View File

@ -156,7 +156,8 @@ Email
Error Reporting Error Reporting
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
* ... * In order to improve accessibility, the technical 404 and 500 error pages now
use HTML landmark elements for the header, footer, and main content areas.
File Storage File Storage
~~~~~~~~~~~~ ~~~~~~~~~~~~

View File

@ -176,6 +176,12 @@ class DebugViewTests(SimpleTestCase):
self.assertContains( self.assertContains(
response, "Django tried these URL patterns", status_code=404 response, "Django tried these URL patterns", status_code=404
) )
self.assertContains(
response,
"<code>technical404/ [name='my404']</code>",
status_code=404,
html=True,
)
self.assertContains( self.assertContains(
response, response,
"<p>The current path, <code>not-in-urls</code>, didnt match any " "<p>The current path, <code>not-in-urls</code>, didnt match any "
@ -204,6 +210,9 @@ class DebugViewTests(SimpleTestCase):
def test_technical_404(self): def test_technical_404(self):
response = self.client.get("/technical404/") response = self.client.get("/technical404/")
self.assertContains(response, '<header id="summary">', status_code=404)
self.assertContains(response, '<main id="info">', status_code=404)
self.assertContains(response, '<footer id="explanation">', status_code=404)
self.assertContains( self.assertContains(
response, response,
'<pre class="exception_value">Testing technical 404.</pre>', '<pre class="exception_value">Testing technical 404.</pre>',
@ -228,7 +237,7 @@ class DebugViewTests(SimpleTestCase):
response = self.client.get("/classbased404/") response = self.client.get("/classbased404/")
self.assertContains( self.assertContains(
response, response,
"<th>Raised by:</th><td>view_tests.views.Http404View</td>", '<th scope="row">Raised by:</th><td>view_tests.views.Http404View</td>',
status_code=404, status_code=404,
html=True, html=True,
) )
@ -236,9 +245,12 @@ class DebugViewTests(SimpleTestCase):
def test_technical_500(self): def test_technical_500(self):
with self.assertLogs("django.request", "ERROR"): with self.assertLogs("django.request", "ERROR"):
response = self.client.get("/raises500/") response = self.client.get("/raises500/")
self.assertContains(response, '<header id="summary">', status_code=500)
self.assertContains(response, '<main id="info">', status_code=500)
self.assertContains(response, '<footer id="explanation">', status_code=500)
self.assertContains( self.assertContains(
response, response,
"<th>Raised during:</th><td>view_tests.views.raises500</td>", '<th scope="row">Raised during:</th><td>view_tests.views.raises500</td>',
status_code=500, status_code=500,
html=True, html=True,
) )
@ -255,7 +267,8 @@ class DebugViewTests(SimpleTestCase):
response = self.client.get("/classbased500/") response = self.client.get("/classbased500/")
self.assertContains( self.assertContains(
response, response,
"<th>Raised during:</th><td>view_tests.views.Raises500View</td>", '<th scope="row">Raised during:</th>'
"<td>view_tests.views.Raises500View</td>",
status_code=500, status_code=500,
html=True, html=True,
) )
@ -397,7 +410,7 @@ class DebugViewTests(SimpleTestCase):
""" """
response = self.client.get("/") response = self.client.get("/")
self.assertContains( self.assertContains(
response, "Page not found <span>(404)</span>", status_code=404 response, "Page not found <small>(404)</small>", status_code=404
) )
def test_template_encoding(self): def test_template_encoding(self):
@ -531,12 +544,12 @@ class ExceptionReporterTests(SimpleTestCase):
self.assertIn( self.assertIn(
'<pre class="exception_value">Can&#x27;t find my keys</pre>', html '<pre class="exception_value">Can&#x27;t find my keys</pre>', html
) )
self.assertIn("<th>Request Method:</th>", html) self.assertIn('<th scope="row">Request Method:</th>', html)
self.assertIn("<th>Request URL:</th>", html) self.assertIn('<th scope="row">Request URL:</th>', html)
self.assertIn('<h3 id="user-info">USER</h3>', html) self.assertIn('<h3 id="user-info">USER</h3>', html)
self.assertIn("<p>jacob</p>", html) self.assertIn("<p>jacob</p>", html)
self.assertIn("<th>Exception Type:</th>", html) self.assertIn('<th scope="row">Exception Type:</th>', html)
self.assertIn("<th>Exception Value:</th>", html) self.assertIn('<th scope="row">Exception Value:</th>', html)
self.assertIn("<h2>Traceback ", html) self.assertIn("<h2>Traceback ", html)
self.assertIn("<h2>Request information</h2>", html) self.assertIn("<h2>Request information</h2>", html)
self.assertNotIn("<p>Request data not supplied</p>", html) self.assertNotIn("<p>Request data not supplied</p>", html)
@ -554,11 +567,11 @@ class ExceptionReporterTests(SimpleTestCase):
self.assertIn( self.assertIn(
'<pre class="exception_value">Can&#x27;t find my keys</pre>', html '<pre class="exception_value">Can&#x27;t find my keys</pre>', html
) )
self.assertNotIn("<th>Request Method:</th>", html) self.assertNotIn('<th scope="row">Request Method:</th>', html)
self.assertNotIn("<th>Request URL:</th>", html) self.assertNotIn('<th scope="row">Request URL:</th>', html)
self.assertNotIn('<h3 id="user-info">USER</h3>', html) self.assertNotIn('<h3 id="user-info">USER</h3>', html)
self.assertIn("<th>Exception Type:</th>", html) self.assertIn('<th scope="row">Exception Type:</th>', html)
self.assertIn("<th>Exception Value:</th>", html) self.assertIn('<th scope="row">Exception Value:</th>', html)
self.assertIn("<h2>Traceback ", html) self.assertIn("<h2>Traceback ", html)
self.assertIn("<h2>Request information</h2>", html) self.assertIn("<h2>Request information</h2>", html)
self.assertIn("<p>Request data not supplied</p>", html) self.assertIn("<p>Request data not supplied</p>", html)
@ -603,10 +616,10 @@ class ExceptionReporterTests(SimpleTestCase):
self.assertIn( self.assertIn(
'<pre class="exception_value">No exception message supplied</pre>', html '<pre class="exception_value">No exception message supplied</pre>', html
) )
self.assertIn("<th>Request Method:</th>", html) self.assertIn('<th scope="row">Request Method:</th>', html)
self.assertIn("<th>Request URL:</th>", html) self.assertIn('<th scope="row">Request URL:</th>', html)
self.assertNotIn("<th>Exception Type:</th>", html) self.assertNotIn('<th scope="row">Exception Type:</th>', html)
self.assertNotIn("<th>Exception Value:</th>", html) self.assertNotIn('<th scope="row">Exception Value:</th>', html)
self.assertNotIn("<h2>Traceback ", html) self.assertNotIn("<h2>Traceback ", html)
self.assertIn("<h2>Request information</h2>", html) self.assertIn("<h2>Request information</h2>", html)
self.assertNotIn("<p>Request data not supplied</p>", html) self.assertNotIn("<p>Request data not supplied</p>", html)
@ -626,8 +639,8 @@ class ExceptionReporterTests(SimpleTestCase):
self.assertIn( self.assertIn(
'<pre class="exception_value">Can&#x27;t find my keys</pre>', html '<pre class="exception_value">Can&#x27;t find my keys</pre>', html
) )
self.assertIn("<th>Exception Type:</th>", html) self.assertIn('<th scope="row">Exception Type:</th>', html)
self.assertIn("<th>Exception Value:</th>", html) self.assertIn('<th scope="row">Exception Value:</th>', html)
self.assertIn("<h2>Traceback ", html) self.assertIn("<h2>Traceback ", html)
self.assertIn("<h2>Request information</h2>", html) self.assertIn("<h2>Request information</h2>", html)
self.assertIn("<p>Request data not supplied</p>", html) self.assertIn("<p>Request data not supplied</p>", html)
@ -650,8 +663,8 @@ class ExceptionReporterTests(SimpleTestCase):
html = reporter.get_traceback_html() html = reporter.get_traceback_html()
self.assertInHTML("<h1>RuntimeError</h1>", html) self.assertInHTML("<h1>RuntimeError</h1>", html)
self.assertIn('<pre class="exception_value">Oops</pre>', html) self.assertIn('<pre class="exception_value">Oops</pre>', html)
self.assertIn("<th>Exception Type:</th>", html) self.assertIn('<th scope="row">Exception Type:</th>', html)
self.assertIn("<th>Exception Value:</th>", html) self.assertIn('<th scope="row">Exception Value:</th>', html)
self.assertIn("<h2>Traceback ", html) self.assertIn("<h2>Traceback ", html)
self.assertIn("<h2>Request information</h2>", html) self.assertIn("<h2>Request information</h2>", html)
self.assertIn("<p>Request data not supplied</p>", html) self.assertIn("<p>Request data not supplied</p>", html)
@ -721,8 +734,8 @@ class ExceptionReporterTests(SimpleTestCase):
html = reporter.get_traceback_html() html = reporter.get_traceback_html()
self.assertInHTML("<h1>RuntimeError</h1>", html) self.assertInHTML("<h1>RuntimeError</h1>", html)
self.assertIn('<pre class="exception_value">Oops</pre>', html) self.assertIn('<pre class="exception_value">Oops</pre>', html)
self.assertIn("<th>Exception Type:</th>", html) self.assertIn('<th scope="row">Exception Type:</th>', html)
self.assertIn("<th>Exception Value:</th>", html) self.assertIn('<th scope="row">Exception Value:</th>', html)
self.assertIn("<h2>Traceback ", html) self.assertIn("<h2>Traceback ", html)
self.assertInHTML('<li class="frame user">Traceback: None</li>', html) self.assertInHTML('<li class="frame user">Traceback: None</li>', html)
self.assertIn( self.assertIn(
@ -981,10 +994,10 @@ class ExceptionReporterTests(SimpleTestCase):
self.assertIn( self.assertIn(
'<pre class="exception_value">I&#x27;m a little teapot</pre>', html '<pre class="exception_value">I&#x27;m a little teapot</pre>', html
) )
self.assertIn("<th>Request Method:</th>", html) self.assertIn('<th scope="row">Request Method:</th>', html)
self.assertIn("<th>Request URL:</th>", html) self.assertIn('<th scope="row">Request URL:</th>', html)
self.assertNotIn("<th>Exception Type:</th>", html) self.assertNotIn('<th scope="row">Exception Type:</th>', html)
self.assertNotIn("<th>Exception Value:</th>", html) self.assertNotIn('<th scope="row">Exception Value:</th>', html)
self.assertIn("<h2>Traceback ", html) self.assertIn("<h2>Traceback ", html)
self.assertIn("<h2>Request information</h2>", html) self.assertIn("<h2>Request information</h2>", html)
self.assertNotIn("<p>Request data not supplied</p>", html) self.assertNotIn("<p>Request data not supplied</p>", html)
@ -996,10 +1009,10 @@ class ExceptionReporterTests(SimpleTestCase):
self.assertIn( self.assertIn(
'<pre class="exception_value">I&#x27;m a little teapot</pre>', html '<pre class="exception_value">I&#x27;m a little teapot</pre>', html
) )
self.assertNotIn("<th>Request Method:</th>", html) self.assertNotIn('<th scope="row">Request Method:</th>', html)
self.assertNotIn("<th>Request URL:</th>", html) self.assertNotIn('<th scope="row">Request URL:</th>', html)
self.assertNotIn("<th>Exception Type:</th>", html) self.assertNotIn('<th scope="row">Exception Type:</th>', html)
self.assertNotIn("<th>Exception Value:</th>", html) self.assertNotIn('<th scope="row">Exception Value:</th>', html)
self.assertIn("<h2>Traceback ", html) self.assertIn("<h2>Traceback ", html)
self.assertIn("<h2>Request information</h2>", html) self.assertIn("<h2>Request information</h2>", html)
self.assertIn("<p>Request data not supplied</p>", html) self.assertIn("<p>Request data not supplied</p>", html)