diff options
author | Sambhav Satija <sambhav13085@iiitd.ac.in> | 2015-08-12 06:23:26 +0530 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-08-12 10:39:07 -0400 |
commit | d0bd5330432e1dda519ebd89606bd0980a36dcb4 (patch) | |
tree | d40cb0e19bb24c43e5f4c67b47b171b45f240e29 /tests/httpwrappers | |
parent | 290145e6616b32a0b0c63f44b7c09d0a4af7dfd5 (diff) | |
download | django-d0bd5330432e1dda519ebd89606bd0980a36dcb4.tar.gz |
Fixed #25254 -- Added JsonResponse json_dumps_params parameter.
Diffstat (limited to 'tests/httpwrappers')
-rw-r--r-- | tests/httpwrappers/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/httpwrappers/tests.py b/tests/httpwrappers/tests.py index 74a8f923cf..9ccd66ddf0 100644 --- a/tests/httpwrappers/tests.py +++ b/tests/httpwrappers/tests.py @@ -504,6 +504,10 @@ class JsonResponseTests(SimpleTestCase): response = JsonResponse({}, encoder=CustomDjangoJSONEncoder) self.assertEqual(json.loads(response.content.decode()), {'foo': 'bar'}) + def test_json_response_passing_arguments_to_json_dumps(self): + response = JsonResponse({'foo': 'bar'}, json_dumps_params={'indent': 2}) + self.assertEqual(response.content.decode(), '{\n "foo": "bar"\n}') + class StreamingHttpResponseTests(SimpleTestCase): def test_streaming_response(self): |