Fixed #30779 -- Improved selection of filenames in technical 500 debug page.

This commit is contained in:
Daniel Hahler 2019-09-17 12:07:47 +02:00 committed by Mariusz Felisiak
parent 9cab261427
commit 377018b6ff
2 changed files with 19 additions and 4 deletions

View File

@ -61,6 +61,7 @@
span.commands a:link {color:#5E5694;}
pre.exception_value { font-family: sans-serif; color: #575757; font-size: 1.5em; margin: 10px 0 10px 0; }
.append-bottom { margin-bottom: 10px; }
.fname { user-select: all; }
</style>
{% if not is_email %}
<script>
@ -137,7 +138,7 @@
{% if lastframe %}
<tr>
<th>Exception Location:</th>
<td>{{ lastframe.filename }} in {{ lastframe.function }}, line {{ lastframe.lineno }}</td>
<td><span class="fname">{{ lastframe.filename }}</span>, line {{ lastframe.lineno }}, in {{ lastframe.function }}</td>
</tr>
{% endif %}
<tr>
@ -224,7 +225,7 @@
</h3></li>
{% endif %}{% endifchanged %}
<li class="frame {{ frame.type }}">
<code>{{ frame.filename }}</code> in <code>{{ frame.function }}</code>
<code class="fname">{{ frame.filename }}</code>, line {{ frame.lineno }}, in {{ frame.function }}
{% if frame.context_line %}
<div class="context" id="c{{ frame.id }}">

View File

@ -438,7 +438,14 @@ class ExceptionReporterTests(SimpleTestCase):
self.assertEqual(last_frame['function'], 'funcName')
self.assertEqual(last_frame['lineno'], 2)
html = reporter.get_traceback_html()
self.assertIn('generated in funcName, line 2', html)
self.assertIn(
'<span class="fname">generated</span>, line 2, in funcName',
html,
)
self.assertIn(
'<code class="fname">generated</code>, line 2, in funcName',
html,
)
self.assertIn(
'"generated", line 2, in funcName\n'
' &lt;source code not available&gt;',
@ -472,7 +479,14 @@ class ExceptionReporterTests(SimpleTestCase):
self.assertEqual(last_frame['function'], 'funcName')
self.assertEqual(last_frame['lineno'], 2)
html = reporter.get_traceback_html()
self.assertIn('generated in funcName, line 2', html)
self.assertIn(
'<span class="fname">generated</span>, line 2, in funcName',
html,
)
self.assertIn(
'<code class="fname">generated</code>, line 2, in funcName',
html,
)
self.assertIn(
'"generated", line 2, in funcName\n'
' &lt;source code not available&gt;',