Opened 4 years ago
Closed 4 years ago
#32470 closed Bug (fixed)
django.test.Client ignores request.urlconf when setting response.resolver_match
Description ¶
This bug is present in versions 2.2+.
When request.urlconf
is set by middleware, and points to a module other than the ROOT_URLCONF
, the test client request will either:
a) Raise a Resolver404
if the path resolved is not part of the ROOT_URLCONF
(even though the client has performed a successful request); or
b) Resolve the path from ROOT_URLCONF
module instead of the one set on the request.urlconf
attribute.
This occurs because the resolution of response.resolver_match
only considers the request path.
Change History (3)
comment:1 by , 4 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 4 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
PR