Opened 4 years ago

Closed 4 years ago

#25249 closed Bug (fixed)

Exception signaling in test client disconnected by nested test client call.

Reported by: pscottdevos Owned by: nobody
Component: Testing framework Version: master
Severity: Normal Keywords: signals, test client, got_request_exception
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

If the test client requests a view which itself makes a test client request exceptions raised after the inner request are suppressed (i.e. the traceback is not displayed). This happens because, when the inner test client completes, it disconnects the got_request_exception signal.

The solution is to set a unique dispatch_uid in exactly the same manner as it is done for the template_rendered signal.

Change History (4)

comment:1 Changed 4 years ago by pscottdevos

A pull request that fixes the problem and includes a unit test is available at:

https://github.com/django/django/pull/5116

comment:2 Changed 4 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:3 Changed 4 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

comment:4 Changed 4 years ago by Tim Graham

Resolution: fixed
Status: newclosed

In 7fa1dd8a80795d7573fe650014c5d23af7557bc7

Fixed #25249 -- Fixed exception handling in nested test client requests.

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