Try something like the following untested code:

>From djanto.test.client import  BOUNDARY, MULTIPART_CONTENT, encode_multipart

...
        encoded_data = encode_multipart({'someParameter':'someValue'})
        response = self.c.put("/path/to/some/api", data=encoded_data,
content_type=MULTIPART_CONTENT, follow=True)

This is basically what 1.3 was doing by default.

Aaron

On 5/14/13, o_r <odd.hogs...@smartm.no> wrote:
> We are about to upgrade from django 1.3 to 1.5, and we are running into
> some problems with some of our tests. This used to work in 1.3:
>
> response=self.c.put("/path/to/some/api",{'someParameter':'someValue'},follow=True),
>
> but it doesn't in 1.5. There is a note about it in the docs that this has
> changed:
>
> If you were using the data parameter in a PUT request without a
> content_type,
> you must encode your data before passing it to the test client and set the
> content_type argument.
>
> Can anyone provide me with an example of how this is done?
>
> Thanks!
>
> Odd-R.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to