mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Add test case with trailing whitespace
This commit is contained in:
parent
4f27b966a5
commit
39a963848b
|
@ -375,6 +375,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