Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
192201d5
Commit
192201d5
authored
Aug 07, 2014
by
Paul Oswald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove dep on python_2_unicode_compatible
python_2_unicode_compatible is not available in all Django versions
parent
66fa40c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
rest_framework/tests/test_description.py
+4
-4
No files found.
rest_framework/tests/test_description.py
View file @
192201d5
...
...
@@ -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
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment