aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/test_description.py
diff options
context:
space:
mode:
authorIgor Kalat2013-06-26 22:12:02 +0200
committerIgor Kalat2013-06-26 22:12:02 +0200
commitc8b0e6c40f6bcf447aa539ff98b9985aa53032ce (patch)
tree68568ce75703347d503e39d525baf0e2c800c6c9 /rest_framework/tests/test_description.py
parent2bf5f6305030d5ebbd5a8a0fd5c31586c08a558d (diff)
downloaddjango-rest-framework-c8b0e6c40f6bcf447aa539ff98b9985aa53032ce.tar.bz2
Refactored get_view_description, moved appropriate tests to test_description.py
Diffstat (limited to 'rest_framework/tests/test_description.py')
-rw-r--r--rest_framework/tests/test_description.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/rest_framework/tests/test_description.py b/rest_framework/tests/test_description.py
index 52c1a34c..bc86e106 100644
--- a/rest_framework/tests/test_description.py
+++ b/rest_framework/tests/test_description.py
@@ -3,8 +3,10 @@
from __future__ import unicode_literals
from django.test import TestCase
from rest_framework.views import APIView
-from rest_framework.compat import apply_markdown
+from rest_framework.compat import apply_markdown, smart_text
from rest_framework.utils.formatting import get_view_name, get_view_description
+from rest_framework.tests.views import (
+ ViewWithNonASCIICharactersInDocstring, UTF8_TEST_DOCSTRING)
# We check that docstrings get nicely un-indented.
DESCRIPTION = """an example docstring
@@ -83,11 +85,10 @@ class TestViewNamesAndDescriptions(TestCase):
Unicode in docstrings should be respected.
"""
- class MockView(APIView):
- """Проверка"""
- pass
-
- self.assertEqual(get_view_description(MockView), "Проверка")
+ self.assertEqual(
+ get_view_description(ViewWithNonASCIICharactersInDocstring),
+ smart_text(UTF8_TEST_DOCSTRING)
+ )
def test_view_description_can_be_empty(self):
"""