diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_description.py | 7 | ||||
| -rw-r--r-- | tests/test_parsers.py | 2 | ||||
| -rw-r--r-- | tests/test_relations_generic.py | 2 | ||||
| -rw-r--r-- | tests/test_renderers.py | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/tests/test_description.py b/tests/test_description.py index 0675d209..78ce2350 100644 --- a/tests/test_description.py +++ b/tests/test_description.py @@ -2,7 +2,8 @@ from __future__ import unicode_literals from django.test import TestCase -from rest_framework.compat import apply_markdown, smart_text +from django.utils.encoding import python_2_unicode_compatible, smart_text +from rest_framework.compat import apply_markdown from rest_framework.views import APIView from .description import ViewWithNonASCIICharactersInDocstring from .description import UTF8_TEST_DOCSTRING @@ -107,6 +108,7 @@ class TestViewNamesAndDescriptions(TestCase): """ # use a mock object instead of gettext_lazy to ensure that we can't end # up with a test case string in our l10n catalog + @python_2_unicode_compatible class MockLazyStr(object): def __init__(self, string): self.s = string @@ -114,9 +116,6 @@ class TestViewNamesAndDescriptions(TestCase): def __str__(self): return self.s - def __unicode__(self): - return self.s - class MockView(APIView): __doc__ = MockLazyStr("a gettext string") diff --git a/tests/test_parsers.py b/tests/test_parsers.py index 88eccef3..d28d8bd4 100644 --- a/tests/test_parsers.py +++ b/tests/test_parsers.py @@ -5,8 +5,8 @@ from django import forms from django.core.files.uploadhandler import MemoryFileUploadHandler from django.test import TestCase from django.utils import unittest +from django.utils.six.moves import StringIO from rest_framework.compat import etree -from rest_framework.compat import StringIO from rest_framework.exceptions import ParseError from rest_framework.parsers import FormParser, FileUploadParser from rest_framework.parsers import XMLParser diff --git a/tests/test_relations_generic.py b/tests/test_relations_generic.py index 380ad91d..b600b333 100644 --- a/tests/test_relations_generic.py +++ b/tests/test_relations_generic.py @@ -3,8 +3,8 @@ from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.generic import GenericRelation, GenericForeignKey from django.db import models from django.test import TestCase +from django.utils.encoding import python_2_unicode_compatible from rest_framework import serializers -from rest_framework.compat import python_2_unicode_compatible @python_2_unicode_compatible diff --git a/tests/test_renderers.py b/tests/test_renderers.py index 416d7f22..22eb5459 100644 --- a/tests/test_renderers.py +++ b/tests/test_renderers.py @@ -7,9 +7,11 @@ from django.core.cache import cache from django.db import models from django.test import TestCase from django.utils import six, unittest +from django.utils.six import BytesIO +from django.utils.six.moves import StringIO from django.utils.translation import ugettext_lazy as _ from rest_framework import status, permissions -from rest_framework.compat import yaml, etree, StringIO, BytesIO +from rest_framework.compat import yaml, etree from rest_framework.response import Response from rest_framework.views import APIView from rest_framework.renderers import BaseRenderer, JSONRenderer, YAMLRenderer, \ |
