#33132: TestClient doesn't follow redirects that only contain a query string
correctly.
---------------------------------------------+------------------------
Reporter: Jaap Roes | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
While running a projects test suite on Django 4.0a1 (using Python 3.8)
some tests unexpectedly started failing.
We have a `FormView` that defines the `get_success_url` method as follows:
{{{
def get_success_url(self):
"""
Redirect to self
"""
success = urllib.parse.urlencode({'success': self.n_deleted})
return f'?{success}'
}}}
In actual browsers this results in a redirect to the original request's
path with the querystring attached. The Django TestClient behaved the same
way, but after the update to Django 4.0a1 it suddenly redirects to
`/?success=1`.
This seems to be caused by the fix for #32790
--
Ticket URL: <https://code.djangoproject.com/ticket/33132>
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/048.cc35e543211dea8eaa8265f82b38e38e%40djangoproject.com.