{{{#!python
if response.status_code in (HTTPStatus.TEMPORARY_REDIRECT,
HTTPStatus.PERMANENT_REDIRECT):
# Preserve request method post-redirect for 307/308 responses.
request_method = getattr(self,
response.request['REQUEST_METHOD'].lower())
else:
request_method = self.get
data = QueryDict(url.query)
content_type = None
}}}
The test client should respect query strings indicated in redirect URLs,
even if the request method is something other than GET or HEAD.
--
Ticket URL: <https://code.djangoproject.com/ticket/31494>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Ahmad Abdallah (added)
* owner: nobody => Ahmad Abdallah
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/31494#comment:3>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/31494#comment:4>
* has_patch: 1 => 0
Comment:
As stated on the PR, this patch is incorrect. Fixing it now.
--
Ticket URL: <https://code.djangoproject.com/ticket/31494#comment:5>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/31494#comment:6>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/31494#comment:7>
* needs_better_patch: 1 => 0
* version: 3.0 => master
--
Ticket URL: <https://code.djangoproject.com/ticket/31494#comment:8>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"6425fd3124e50219ba0b6f545d1bf7edfb053a59" 6425fd3]:
{{{
#!CommitTicketReference repository=""
revision="6425fd3124e50219ba0b6f545d1bf7edfb053a59"
Refs #31494 -- Added test for query strings for GET/HEAD requests when
following HTTP 307/308 redirects in test client.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31494#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"7c947f0f5a0539add9adf8c4e14726ea509e13ef" 7c947f0]:
{{{
#!CommitTicketReference repository=""
revision="7c947f0f5a0539add9adf8c4e14726ea509e13ef"
Fixed #31494 -- Preserved query strings when following HTTP 307/308
redirects in test client.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31494#comment:10>