diff --git a/djangorestframework/tests/request.py b/djangorestframework/tests/request.py index 2bb90c0ab..ede5d5d79 100644 --- a/djangorestframework/tests/request.py +++ b/djangorestframework/tests/request.py @@ -4,6 +4,7 @@ Tests for content parsing, and form-overloaded content parsing. from django.conf.urls.defaults import patterns from django.contrib.auth.models import User from django.test import TestCase, Client +from django.test.client import MULTIPART_CONTENT, BOUNDARY, encode_multipart from djangorestframework import status from djangorestframework.authentication import SessionAuthentication @@ -94,7 +95,8 @@ class TestContentParsing(TestCase): """ data = {'qwerty': 'uiop'} parsers = (FormParser, MultiPartParser) - request = factory.put('/', data, parsers=parsers) + request = factory.put('/', encode_multipart(BOUNDARY, data), parsers=parsers, + content_type=MULTIPART_CONTENT) self.assertEqual(request.DATA.items(), data.items()) def test_standard_behaviour_determines_non_form_content_PUT(self):