#18860: GET-parameters in `path` argument of `django.test.client.Client.get`
------------------------------------+--------------------------------------
Reporter: lagunov.vladimir@… | Owner: nobody
Type: Bug | Status: closed
Component: Testing framework | Version: 1.4
Severity: Normal | Resolution: invalid
Keywords: Client | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Changes (by russellm):
* status: new => closed
* resolution: => invalid
* needs_tests: 0 => 1
Comment:
For context - there's a bit of history in play here. Once upon a time, you
couldn't provide GET arguments in the query argument; you could only use
the data argument. The test client was then modified to allow you to
provide both a URL encoded query, and a data argument. This was done for
two reasons:
1) Convenience in testing simple GET requests
2) Handling POSTs to URLs that contained query argument (e.g., POST
"foo=whiz; pork=spam" to http://example.com/?foo=bar ).
The browser should always be the reference point here; So - What does a
browser do if you submit a form using GET to http://example.com/?whiz=bang
with a form payload of 'foo=whiz; pork=spam'? *That* is what the test
client should do.
From my testing, if you use GET to submit a form with 'foo=whiz;
pork=spam' to .?whiz=bang, the whiz=bang part is lost; you only get the
foo and pork keys. This matches the existing behavior of the test client
(allowing for the historical usage where GET arguments couldn't be passed
in on the query itself).
So - I'm satisfied that the existing behavior is correct, and I'm marking
the ticket invalid; however, if someone can make a case for another
interpretation, feel free to reopen the ticket.
--
Ticket URL: <https://code.djangoproject.com/ticket/18860#comment:2>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.