Commit 09f2bdd2 by Tom Christie

Added test for utf8 strings in docstrings of views.

parent cf6c95de
# -- 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): ...@@ -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'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment