diff options
| author | Tom Christie | 2013-02-06 00:53:41 -0800 |
|---|---|---|
| committer | Tom Christie | 2013-02-06 00:53:41 -0800 |
| commit | 72fe686623f63b79fa2b7f7de177c6d98bc1da3f (patch) | |
| tree | 5d0834d4eb2caf21ed54a4dcba9a4a3a40e6fa99 /rest_framework/tests/response.py | |
| parent | 221e77d3575c182eb49d50546f844f392a5f7ba6 (diff) | |
| parent | bdc97c561147130b59c8cd8cc6bc735eab8b223d (diff) | |
| download | django-rest-framework-72fe686623f63b79fa2b7f7de177c6d98bc1da3f.tar.bz2 | |
Merge pull request #636 from tomchristie/2.2
2.2 Release
Diffstat (limited to 'rest_framework/tests/response.py')
| -rw-r--r-- | rest_framework/tests/response.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rest_framework/tests/response.py b/rest_framework/tests/response.py index 875f4d42..3e1da905 100644 --- a/rest_framework/tests/response.py +++ b/rest_framework/tests/response.py @@ -1,3 +1,4 @@ +from __future__ import unicode_literals from django.test import TestCase from rest_framework.compat import patterns, url, include from rest_framework.response import Response @@ -9,6 +10,7 @@ from rest_framework.renderers import ( BrowsableAPIRenderer ) from rest_framework.settings import api_settings +from rest_framework.compat import six class MockPickleRenderer(BaseRenderer): @@ -22,8 +24,8 @@ class MockJsonRenderer(BaseRenderer): DUMMYSTATUS = status.HTTP_200_OK DUMMYCONTENT = 'dummycontent' -RENDERER_A_SERIALIZER = lambda x: 'Renderer A: %s' % x -RENDERER_B_SERIALIZER = lambda x: 'Renderer B: %s' % x +RENDERER_A_SERIALIZER = lambda x: ('Renderer A: %s' % x).encode('ascii') +RENDERER_B_SERIALIZER = lambda x: ('Renderer B: %s' % x).encode('ascii') class RendererA(BaseRenderer): @@ -92,7 +94,7 @@ class RendererIntegrationTests(TestCase): resp = self.client.head('/') self.assertEquals(resp.status_code, DUMMYSTATUS) self.assertEquals(resp['Content-Type'], RendererA.media_type) - self.assertEquals(resp.content, '') + self.assertEquals(resp.content, six.b('')) def test_default_renderer_serializes_content_on_accept_any(self): """If the Accept header is set to */* the default renderer should serialize the response.""" |
