Opened 9 years ago

Closed 9 years ago

#11786 closed (duplicate)

TestClient() forgets any PUT querystrings if there is payload data

Reported by: steve@… Owned by: nobody
Component: Testing framework Version: 1.1
Severity: Keywords: PUT
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:



On line 370 of there is the following line in the put() method:

'QUERY_STRING': urlencode(data, doseq=True) or parsed[4],

(by comparison, post() has:

'QUERY_STRING': parsed[4],

As a a result of the way the code is in put(), if there is a querystring (eg user_token=foo123) and also payload data with the PUT { foo:'12' } , the querystring is overwritten with the payload data.

Now, I'm not 100% whether PUT can take querystrings and payload data at the same time, but if it is supposed to, how about instead we have line 370 as:

'QUERY_STRING': parsed[4] or urlencode(data, doseq=True),

Which seems to work fine (ie, my app's tests now pass)

Change History (1)

comment:1 Changed 9 years ago by Karen Tracey

Resolution: duplicate
Status: newclosed

#11371 looks like the same issue.

Note: See TracTickets for help on using tickets.
Back to Top