#11786: TestClient() forgets any PUT querystrings if there is payload data ------------------------------------+--------------------------------------- Reporter: st...@stevejalim.co.uk | Owner: nobody Status: new | Milestone: Component: Testing framework | Version: 1.1 Keywords: PUT | Stage: Unreviewed Has_patch: 0 | ------------------------------------+--------------------------------------- Hi
On line 370 of contrib.test.client.py 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) -- Ticket URL: <http://code.djangoproject.com/ticket/11786> Django <http://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 django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---