#32470: django.test.Client ignores request.urlconf when setting
response.resolver_match
-------------------------------------+-------------------------------------
Reporter: Marc | Owner: Marc Gibbons
Gibbons |
Type: Bug | Status: assigned
Component: Testing | Version: master
framework | Keywords: test
Severity: Normal |
client,urlconf,middleware,resolver_match,request,response
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/32470>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/054.5b2c7f998a24606ee2d197fc44cc0e84%40djangoproject.com.