Bizarre behaviour using django.test.client.Client.put

33 views
Skip to first unread message

Oliver Beattie

unread,
Jul 11, 2011, 11:18:47 AM7/11/11
to django-d...@googlegroups.com
Hi,

I don't really know if what I'm posting is expected behaviour or not (hence not going straight to Trac), but I am seeing very odd behaviour using django.test.client.Client.put.

The documentation describes the put method as "acting just like Client.post()", but it seems this isn't really true at all. post() preserves data which has been encoded into the query string (and is documented to do so), but it seems that put() does not. It is nearly always overwritten by what the developer likely intended for the request body. Here's the offending code (please forgive the GitHub links).

The curious thing is this seems to have been implemented as a response to a ticket that I'm having trouble following, #11371 (a bit of a brain overload today).

Is this really intended behaviour?

—Oliver

Oliver Beattie

unread,
Jul 11, 2011, 11:23:53 AM7/11/11
to django-d...@googlegroups.com
I should clarify, this is only an issue when wanting to put data both in the query string and the request body.
Reply all
Reply to author
Forward
0 new messages