From 39a963848b1d89ef69c76b0d3370486ba9970fce Mon Sep 17 00:00:00 2001 From: William Stewart Date: Mon, 19 Jan 2015 13:32:07 +0200 Subject: [PATCH] Add test case with trailing whitespace --- tests/test_renderers.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_renderers.py b/tests/test_renderers.py index 00a24fb12..ead5c06aa 100644 --- a/tests/test_renderers.py +++ b/tests/test_renderers.py @@ -375,6 +375,26 @@ class JSONRendererTests(TestCase): content = renderer.render(obj, 'application/json; indent=2') 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): """