aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/tests/request.py
diff options
context:
space:
mode:
authorMjumbe Wawatu Poe2012-09-07 18:44:57 -0400
committerMjumbe Wawatu Poe2012-09-07 18:45:23 -0400
commitf729d0eb0b8901f18799bb714c60d54c73a1ec98 (patch)
treec44e09982349efd8fb4d695aa5e5ae2e1671c86a /djangorestframework/tests/request.py
parent7d9125bcb69950e54bb9c2ca61f59403c1018178 (diff)
downloaddjango-rest-framework-f729d0eb0b8901f18799bb714c60d54c73a1ec98.tar.bz2
Fix Django master support.
- Explicitly encode PUT data as multipart, as Django 1.5 no longer does so by default in the test client
Diffstat (limited to 'djangorestframework/tests/request.py')
-rw-r--r--djangorestframework/tests/request.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/djangorestframework/tests/request.py b/djangorestframework/tests/request.py
index 2bb90c0a..ede5d5d7 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):