mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +03:00
remove dep on python_2_unicode_compatible
python_2_unicode_compatible is not available in all Django versions
This commit is contained in:
parent
66fa40c300
commit
192201d584
|
@ -2,7 +2,6 @@
|
|||
|
||||
from __future__ import unicode_literals
|
||||
from django.test import TestCase
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from rest_framework.compat import apply_markdown, smart_text
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework.tests.description import ViewWithNonASCIICharactersInDocstring
|
||||
|
@ -108,17 +107,18 @@ 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
|
||||
def __str__(self):
|
||||
return self.s
|
||||
def __unicode__(self):
|
||||
return self.s
|
||||
|
||||
class MockView(APIView):
|
||||
__doc__ = MockLazyStr("a gettext string")
|
||||
__doc__ = MockLazyStr(u"a gettext string")
|
||||
|
||||
self.assertEqual(MockView().get_view_description(), 'a gettext string')
|
||||
self.assertEqual(MockView().get_view_description(), u'a gettext string')
|
||||
|
||||
def test_markdown(self):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user