Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#29758 closed Cleanup/optimization (fixed)

Document testing custom error handlers

Reported by: Adam Johnson Owned by: cammil
Component: Documentation Version: 2.1
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As discussed in #29642, testing custom error handlers is trickier than it appears at first sight - to accurately simulate their arguments, it's best to actually raise the triggering exceptions, as Django's own test suite does: https://github.com/django/django/blob/master/tests/handlers/tests_custom_error_handlers.py#L23

This could be documented to help users setting out to customize the errors Django returns

Change History (6)

comment:1 by Carlton Gibson, 6 years ago

Triage Stage: UnreviewedAccepted

Yes. I've been down this road. Having this documented would be helpful I think.

comment:2 by cammil, 6 years ago

Owner: changed from nobody to cammil
Status: newassigned

comment:3 by Tim Graham, 6 years ago

Has patch: set

comment:4 by Carlton Gibson, 6 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In f83a689f:

Fixed #29758 -- Documented how to test custom error views.

comment:6 by Tim Graham <timograham@…>, 6 years ago

In cd9391c:

[2.1.x] Fixed #29758 -- Documented how to test custom error views.

Backport of f83a689f617d119a2bed23032919cea98c424c58 from master

Note: See TracTickets for help on using tickets.
Back to Top