diff options
| author | Tom Christie | 2013-02-22 20:17:47 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-02-22 20:17:47 +0000 |
| commit | 09f2bdd21998dd64b38285ee244a760f711793f5 (patch) | |
| tree | 79f42fc6b31d51671bc89dc7eb98c3d96c1a81da | |
| parent | cf6c95de0112eb7d1c524849e907b586513cdf63 (diff) | |
| download | django-rest-framework-09f2bdd21998dd64b38285ee244a760f711793f5.tar.bz2 | |
Added test for utf8 strings in docstrings of views.
| -rw-r--r-- | rest_framework/tests/description.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rest_framework/tests/description.py b/rest_framework/tests/description.py index 20963a9c..b564a1d4 100644 --- a/rest_framework/tests/description.py +++ b/rest_framework/tests/description.py @@ -1,3 +1,5 @@ +# -- coding: utf-8 -- + from __future__ import unicode_literals from django.test import TestCase from rest_framework.views import APIView @@ -91,6 +93,15 @@ class TestViewNamesAndDescriptions(TestCase): return example self.assertEquals(MockView().get_description(), example) + def test_resource_description_supports_unicode(self): + + class MockView(APIView): + """Проверка""" + pass + + self.assertEquals(MockView().get_description(), "Проверка") + + def test_resource_description_does_not_require_docstring(self): """Ensure that empty docstrings do not affect the Resource's description if it has been set using the 'get_description' method.""" example = 'Some other description' |
