diff options
| author | Tom Christie | 2014-12-05 13:14:14 +0000 |
|---|---|---|
| committer | Tom Christie | 2014-12-05 13:14:14 +0000 |
| commit | 65d6cba75f9db0995020f01e9144b6660feb47d6 (patch) | |
| tree | 1212187336ad9f887a4c69dc805506d49f42b86e /tests/test_description.py | |
| parent | 9fb1b396db751234a531dabacb6758ac2645776c (diff) | |
| parent | d9930181ee157f51e2fcea33a3af5ea397647324 (diff) | |
| download | django-rest-framework-65d6cba75f9db0995020f01e9144b6660feb47d6.tar.bz2 | |
Merge pull request #2200 from maryokhin/master
Clean up compat code
Diffstat (limited to 'tests/test_description.py')
| -rw-r--r-- | tests/test_description.py | 7 |
1 files changed, 3 insertions, 4 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") |
