This commit is contained in:
William Martin Stewart 2017-04-16 09:07:40 +00:00 committed by GitHub
commit 6372c04683

View File

@ -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):
""" """