mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-06-19 13:03:19 +03:00
Added test for utf8 strings in docstrings of views.
This commit is contained in:
parent
cf6c95de01
commit
09f2bdd219
|
@ -1,3 +1,5 @@
|
||||||
|
# -- coding: utf-8 --
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
|
@ -91,6 +93,15 @@ class TestViewNamesAndDescriptions(TestCase):
|
||||||
return example
|
return example
|
||||||
self.assertEquals(MockView().get_description(), 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):
|
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."""
|
"""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'
|
example = 'Some other description'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user