mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
Merge 39a963848b
into fd72a814f8
This commit is contained in:
commit
6372c04683
|
@ -376,6 +376,26 @@ class JSONRendererTests(TestCase):
|
||||||
content = renderer.render(obj, 'application/json; indent=2')
|
content = renderer.render(obj, 'application/json; indent=2')
|
||||||
self.assertEqual(strip_trailing_whitespace(content.decode('utf-8')), _indented_repr)
|
self.assertEqual(strip_trailing_whitespace(content.decode('utf-8')), _indented_repr)
|
||||||
|
|
||||||
|
def test_with_content_type_args(self):
|
||||||
|
"""
|
||||||
|
Test JSON rendering with additional content type arguments supplied.
|
||||||
|
"""
|
||||||
|
obj = {'foo': ['bar', 'baz']}
|
||||||
|
renderer = JSONRenderer()
|
||||||
|
content = renderer.render(obj, 'application/json; indent=2')
|
||||||
|
self.assertEqual(strip_trailing_whitespace(content.decode('utf-8')),
|
||||||
|
_indented_repr)
|
||||||
|
|
||||||
|
def test_with_trailing_whitespace(self):
|
||||||
|
"""
|
||||||
|
Test JSON rendering with additional content type arguments supplied.
|
||||||
|
"""
|
||||||
|
obj = {'foo': ['bar', 'baz']}
|
||||||
|
renderer = JSONRenderer()
|
||||||
|
content = renderer.render(obj, 'application/json; indent=2')
|
||||||
|
self.assertEqual((content.decode('utf-8')),
|
||||||
|
_indented_repr)
|
||||||
|
|
||||||
|
|
||||||
class UnicodeJSONRendererTests(TestCase):
|
class UnicodeJSONRendererTests(TestCase):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user