mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 08:14:16 +03:00
Fix Django master support.
- Explicitly encode PUT data as multipart, as Django 1.5 no longer does so by default in the test client
This commit is contained in:
parent
7d9125bcb6
commit
f729d0eb0b
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue
Block a user