Opened 9 years ago
Closed 9 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: | dev |
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 by , 9 years ago
comment:2 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:4 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In 7fa1dd8a80795d7573fe650014c5d23af7557bc7
Fixed #25249 -- Fixed exception handling in nested test client requests.
A pull request that fixes the problem and includes a unit test is available at:
https://github.com/django/django/pull/5116