0001-backoffice-truncate-error-details-in-errors_block-42.patch
tests/test_backoffice_pages.py | ||
---|---|---|
5755 | 5755 |
resp = resp.form.submit('submit') |
5756 | 5756 |
assert LoggedError.count() == 2 |
5757 | 5757 | |
5758 |
app = login(get_app(pub)) |
|
5759 |
resp = app.get('/backoffice/workflows/%s/' % workflow.id) |
|
5760 |
assert 'Failed to evaluate condition' in resp.text |
|
5761 |
assert "error NameError (name 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..." in resp.text |
|
5762 | ||
5758 | 5763 |
# remove formdef |
5759 | 5764 |
FormDef.wipe() |
5760 | 5765 |
resp = resp2.click('Failed to evaluate condition') |
5761 |
assert not 'href="http://example.net/backoffice/management/test/' in resp.text
|
|
5766 |
assert 'href="http://example.net/backoffice/management/test/' not in resp.text
|
|
5762 | 5767 | |
5763 | 5768 | |
5764 | 5769 |
def test_backoffice_formdata_named_wscall(http_requests, pub): |
wcs/admin/logged_errors.py | ||
---|---|---|
16 | 16 | |
17 | 17 |
import re |
18 | 18 | |
19 |
from django.utils.text import Truncator |
|
19 | 20 |
from quixote import get_response, get_publisher, redirect |
20 | 21 |
from quixote.directory import Directory |
21 | 22 |
from quixote.html import TemplateIO, htmltext |
... | ... | |
180 | 181 |
for error in errors[:3]: |
181 | 182 |
r += htmltext('<li><a href="logged-errors/%s/">%s</a> ') % (error.id, error.summary) |
182 | 183 |
if error.exception_class or error.exception_message: |
183 |
r += htmltext(_('error %(class)s (%(message)s)')) % {
|
|
184 |
message = _('error %(class)s (%(message)s)') % {
|
|
184 | 185 |
'class': error.exception_class, |
185 | 186 |
'message': error.exception_message, |
186 | 187 |
} |
188 |
message = Truncator(message).chars(80) |
|
189 |
r += htmltext(message) |
|
187 | 190 |
r += htmltext('</li>') |
188 | 191 |
if len(errors) > 3: |
189 | 192 |
r += htmltext('<li>...</li>') |
190 |
- |