aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/tests
diff options
context:
space:
mode:
authorTom Christie2012-09-07 22:40:05 -0700
committerTom Christie2012-09-07 22:40:05 -0700
commit274420c658b406ba27c58c4a66f4c8261ce91b4f (patch)
tree67f537d84bdb46f3998fa4f25fb0e365fd531041 /djangorestframework/tests
parent8f119a8c34c1ebb3cf82152aa7900d316f64c0d8 (diff)
parent9c007a6197ca5125bed774cf3089de7759e755d1 (diff)
downloaddjango-rest-framework-274420c658b406ba27c58c4a66f4c8261ce91b4f.tar.bz2
Merge pull request #251 from mjumbewu/1.3-support
Fix Django 1.3 compatibility
Diffstat (limited to 'djangorestframework/tests')
-rw-r--r--djangorestframework/tests/request.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/djangorestframework/tests/request.py b/djangorestframework/tests/request.py
index 2bb90c0a..8b2f66ee 100644
--- a/djangorestframework/tests/request.py
+++ b/djangorestframework/tests/request.py
@@ -94,7 +94,16 @@ class TestContentParsing(TestCase):
"""
data = {'qwerty': 'uiop'}
parsers = (FormParser, MultiPartParser)
- request = factory.put('/', data, parsers=parsers)
+
+ from django import VERSION
+
+ if VERSION >= (1, 5):
+ from django.test.client import MULTIPART_CONTENT, BOUNDARY, encode_multipart
+ request = factory.put('/', encode_multipart(BOUNDARY, data), parsers=parsers,
+ content_type=MULTIPART_CONTENT)
+ else:
+ request = factory.put('/', data, parsers=parsers)
+
self.assertEqual(request.DATA.items(), data.items())
def test_standard_behaviour_determines_non_form_content_PUT(self):