diff options
| author | Tom Christie | 2013-02-04 20:37:09 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-02-04 20:37:09 +0000 |
| commit | 8e846bdf52f03d0733ac73e418152800e582b898 (patch) | |
| tree | cd7034d5573f1e264798a618c88addc4d2f45ce0 /rest_framework/tests/request.py | |
| parent | d9b73e15c87c3a7f11d6bea5ffd6118f86e40051 (diff) | |
| parent | 97f2b994951605ffdef08159be450d1e77762bf9 (diff) | |
| download | django-rest-framework-8e846bdf52f03d0733ac73e418152800e582b898.tar.bz2 | |
Merge branch 'py3k' into 2.2
Conflicts:
rest_framework/relations.py
rest_framework/serializers.py
rest_framework/tests/relations_hyperlink.py
rest_framework/tests/relations_slug.py
Diffstat (limited to 'rest_framework/tests/request.py')
| -rw-r--r-- | rest_framework/tests/request.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/rest_framework/tests/request.py b/rest_framework/tests/request.py index 4b032405..92b1bfd8 100644 --- a/rest_framework/tests/request.py +++ b/rest_framework/tests/request.py @@ -20,6 +20,7 @@ from rest_framework.request import Request from rest_framework.response import Response from rest_framework.settings import api_settings from rest_framework.views import APIView +from rest_framework.compat import six factory = RequestFactory() @@ -79,14 +80,14 @@ class TestContentParsing(TestCase): data = {'qwerty': 'uiop'} request = Request(factory.post('/', data)) request.parsers = (FormParser(), MultiPartParser()) - self.assertEqual(request.DATA.items(), data.items()) + self.assertEqual(list(request.DATA.items()), list(data.items())) def test_request_DATA_with_text_content(self): """ Ensure request.DATA returns content for POST request with non-form content. """ - content = 'qwerty' + content = six.b('qwerty') content_type = 'text/plain' request = Request(factory.post('/', content, content_type=content_type)) request.parsers = (PlainTextParser(),) @@ -99,7 +100,7 @@ class TestContentParsing(TestCase): data = {'qwerty': 'uiop'} request = Request(factory.post('/', data)) request.parsers = (FormParser(), MultiPartParser()) - self.assertEqual(request.POST.items(), data.items()) + self.assertEqual(list(request.POST.items()), list(data.items())) def test_standard_behaviour_determines_form_content_PUT(self): """ @@ -117,14 +118,14 @@ class TestContentParsing(TestCase): request = Request(factory.put('/', data)) request.parsers = (FormParser(), MultiPartParser()) - self.assertEqual(request.DATA.items(), data.items()) + self.assertEqual(list(request.DATA.items()), list(data.items())) def test_standard_behaviour_determines_non_form_content_PUT(self): """ Ensure request.DATA returns content for PUT request with non-form content. """ - content = 'qwerty' + content = six.b('qwerty') content_type = 'text/plain' request = Request(factory.put('/', content, content_type=content_type)) request.parsers = (PlainTextParser(), ) |
