diff options
| author | Tom Christie | 2013-06-26 14:41:07 -0700 |
|---|---|---|
| committer | Tom Christie | 2013-06-26 14:41:07 -0700 |
| commit | 35e4d1cf9cdc71d1ac6501feb0337d27a1cf946e (patch) | |
| tree | 740fd49cbc21b8c84381f77b2340b84588d928bf /rest_framework/tests/test_description.py | |
| parent | 69e5e3cc0db481e4fad7ac34bf28b73f4786e790 (diff) | |
| parent | c8b0e6c40f6bcf447aa539ff98b9985aa53032ce (diff) | |
| download | django-rest-framework-35e4d1cf9cdc71d1ac6501feb0337d27a1cf946e.tar.bz2 | |
Merge pull request #943 from trwired/utf8safedocs
Make browsable API views play nice with utf-8
Diffstat (limited to 'rest_framework/tests/test_description.py')
| -rw-r--r-- | rest_framework/tests/test_description.py | 13 |
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): """ |
