Skip to content

HttpForbidden and Http404 are logged in test runner #1709

Closed as not planned
Closed as not planned
@Shriukan33

Description

@Shriukan33

Hello,

I've updated my django-debug-toolbar from 3.2.4 to 3.7 and I noticed that the traceback was printed when the tests encountered 404 or 403 responses.

I was wondering if I could disable that ? Back in 3.2.4 the test results wouldn't be polluted with errors tracebacks.

Example :

Traceback (most recent call last):
  File "/home/benja/Documents/GitHub/tn_web/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/benja/Documents/GitHub/tn_web/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/benja/Documents/GitHub/tn_web/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 103, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/benja/Documents/GitHub/tn_web/venv/lib/python3.8/site-packages/django/contrib/auth/mixins.py", line 108, in dispatch
    return self.handle_no_permission()
  File "/home/benja/Documents/GitHub/tn_web/venv/lib/python3.8/site-packages/django/contrib/auth/mixins.py", line 48, in handle_no_permission
    raise PermissionDenied(self.get_permission_denied_message())
django.core.exceptions.PermissionDenied
Not Found: /tb/admin/panel/view/999999999/
Not Found: /tb/admin/panel/view/1/
.Not Found: /tb/panel/bad-slug/

Except those tests do expect to produce 403/404 responses.

I don't see the link with django-debug-toolbar but the behavior doesn't happen when I rollback to 3.2.4 so I guess there is something ?

Thank you !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions