Opened 4 years ago

Closed 4 years ago

Last modified 4 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 Changed 4 years ago by Carlton Gibson

Triage Stage: UnreviewedAccepted

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

comment:2 Changed 4 years ago by cammil

Owner: changed from nobody to cammil
Status: newassigned

comment:3 Changed 4 years ago by Tim Graham

Has patch: set

comment:4 Changed 4 years ago by Carlton Gibson

Triage Stage: AcceptedReady for checkin

comment:5 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In f83a689f:

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

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

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