#31430: Bug in django.test.client.Client._handle_redirects.
-----------------------------------+---------------------------------------
Reporter: Jacob Stöhr | Owner: Jacob Stöhr
Type: Bug | Status: closed
Component: Testing framework | Version: master
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+---------------------------------------
Comment (by Jacob Stöhr):
Thank you for your speedy response!
I have now been debugging my issue for another ~2 hours (and I havent seen
your mail until just now), turns out this was not django's fault (of
course) but a commit no other than myself made 8 months ago that caused
the problem in our project.
I foolishly returned a bare `HttpResponse(status=308)` and overwrote the
`Location` to force a redirect. This of course failed in the
`_handle_redirects` method of the testclient because the `status_code` was
in `redirect_status_codes` but the response was not based on
`HttpResponseRedirectBase` and did thus not have the `url` property.
Your suggestion is of course correct, I will fix it in our project. Thank
you very much :)
--
Ticket URL: <https://code.djangoproject.com/ticket/31430#comment:4>
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/069.d8d91271ececf12554c76031dfde6c64%40djangoproject.com.