|
2 | 2 |
|
3 | 3 | from __future__ import unicode_literals
|
4 | 4 | from django.test import TestCase
|
5 |
| -from rest_framework.views import APIView |
6 | 5 | from rest_framework.compat import apply_markdown, smart_text
|
| 6 | +from rest_framework.views import APIView |
| 7 | +from rest_framework.tests.description import ViewWithNonASCIICharactersInDocstring |
| 8 | +from rest_framework.tests.description import UTF8_TEST_DOCSTRING |
7 | 9 | from rest_framework.utils.formatting import get_view_name, get_view_description
|
8 | 10 |
|
9 | 11 | # We check that docstrings get nicely un-indented.
|
|
49 | 51 | <h2 id="hash-style-header">hash style header</h2>"""
|
50 | 52 |
|
51 | 53 |
|
52 |
| -# test strings snatched from http://www.columbia.edu/~fdc/utf8/, |
53 |
| -# http://winrus.com/utf8-jap.htm and memory |
54 |
| -UTF8_TEST_DOCSTRING = ( |
55 |
| - 'zażółć gęślą jaźń' |
56 |
| - 'Sîne klâwen durh die wolken sint geslagen' |
57 |
| - 'Τη γλώσσα μου έδωσαν ελληνική' |
58 |
| - 'யாமறிந்த மொழிகளிலே தமிழ்மொழி' |
59 |
| - 'На берегу пустынных волн' |
60 |
| - 'てすと' |
61 |
| - 'アイウエオカキクケコサシスセソタチツテ' |
62 |
| -) |
63 |
| - |
64 |
| - |
65 |
| -# Apparently there is an issue where docstrings of imported view classes |
66 |
| -# do not retain their encoding information even if a module has a proper |
67 |
| -# encoding declaration at the top of its source file. Therefore for tests |
68 |
| -# to catch unicode related errors, a mock view has to be declared in a separate |
69 |
| -# module. |
70 |
| -class ViewWithNonASCIICharactersInDocstring(APIView): |
71 |
| - __doc__ = UTF8_TEST_DOCSTRING |
72 |
| - |
73 |
| - |
74 | 54 | class TestViewNamesAndDescriptions(TestCase):
|
75 | 55 | def test_view_name_uses_class_name(self):
|
76 | 56 | """
|
|
0 commit comments