#12607: django.test.client.Client changes the HTTP method to "GET" when doing a
redirect.
-------------------------------------------+--------------------------------
Reporter: pbiggar | Owner: nobody
Status: new | Milestone: 1.2
Component: Testing framework | Version: 1.2-alpha
Keywords: get redirect _handle_redirect | Stage: Unreviewed
Has_patch: 0 |
-------------------------------------------+--------------------------------
With the code:
Client().post(path, {}, follow=True)
where path causes a redirect, the HTTP verb will be changed to a GET. This
is probably due to line 949 of
http://code.djangoproject.com/svn/django/trunk/django/test/client.py.
_handle_redirect is called from post(), put(), delete() etc, even though
it redirects by calling get().
(My knowledge of HTTP is hazy, but it seems wrong to change this.)
Workaround: make sure tests dont redirect (which probably means avoid the
automatic redirection of leaving a '/' off the end of paths).
I'm experiencing this with Django 1.1, but it looks like its still present
in svn.
--
Ticket URL: <
http://code.djangoproject.com/ticket/12607>
Django <
http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.