Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
617c9825
Commit
617c9825
authored
Apr 15, 2014
by
Miro Hrončok
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for UnicodeYAMLRenderer
parent
f68596a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
rest_framework/tests/test_renderers.py
+12
-1
No files found.
rest_framework/tests/test_renderers.py
View file @
617c9825
...
...
@@ -12,7 +12,7 @@ from rest_framework.compat import yaml, etree, patterns, url, include, six, Stri
from
rest_framework.response
import
Response
from
rest_framework.views
import
APIView
from
rest_framework.renderers
import
BaseRenderer
,
JSONRenderer
,
YAMLRenderer
,
\
XMLRenderer
,
JSONPRenderer
,
BrowsableAPIRenderer
,
UnicodeJSONRenderer
XMLRenderer
,
JSONPRenderer
,
BrowsableAPIRenderer
,
UnicodeJSONRenderer
,
UnicodeYAMLRenderer
from
rest_framework.parsers
import
YAMLParser
,
XMLParser
from
rest_framework.settings
import
api_settings
from
rest_framework.test
import
APIRequestFactory
...
...
@@ -467,6 +467,17 @@ if yaml:
self
.
assertTrue
(
string
in
content
,
'
%
r not in
%
r'
%
(
string
,
content
))
class
UnicodeYAMLRendererTests
(
TestCase
):
"""
Tests specific for the Unicode YAML Renderer
"""
def
test_proper_encoding
(
self
):
obj
=
{
'countries'
:
[
'United Kingdom'
,
'France'
,
'España'
]}
renderer
=
UnicodeYAMLRenderer
()
content
=
renderer
.
render
(
obj
,
'application/yaml'
)
self
.
assertEqual
(
content
.
strip
(),
'countries: [United Kingdom, France, España]'
.
encode
(
'utf-8'
))
class
XMLRendererTestCase
(
TestCase
):
"""
Tests specific to the XML Renderer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment