From 928c12eb1a75dbcab22b64f8cf0afb17389c20d2 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Mon, 15 Feb 2016 19:28:49 +0100 Subject: Fixed #26215 -- Fixed RangeField/ArrayField serialization with None values Also added tests for HStoreField and JSONField. Thanks Aleksey Bukin for the report and Tim Graham for the initial patch and the review. --- tests/postgres_tests/test_json.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/postgres_tests/test_json.py') diff --git a/tests/postgres_tests/test_json.py b/tests/postgres_tests/test_json.py index b4f0dd4ecf..59e5fe3fe7 100644 --- a/tests/postgres_tests/test_json.py +++ b/tests/postgres_tests/test_json.py @@ -213,16 +213,16 @@ class TestQuerying(TestCase): @skipUnlessPG94 class TestSerialization(TestCase): - test_data = '[{"fields": {"field": {"a": "b"}}, "model": "postgres_tests.jsonmodel", "pk": null}]' + test_data = '[{"fields": {"field": {"a": "b", "c": null}}, "model": "postgres_tests.jsonmodel", "pk": null}]' def test_dumping(self): - instance = JSONModel(field={'a': 'b'}) + instance = JSONModel(field={'a': 'b', 'c': None}) data = serializers.serialize('json', [instance]) self.assertJSONEqual(data, self.test_data) def test_loading(self): instance = list(serializers.deserialize('json', self.test_data))[0].object - self.assertEqual(instance.field, {'a': 'b'}) + self.assertEqual(instance.field, {'a': 'b', 'c': None}) class TestValidation(PostgreSQLTestCase): -- cgit v1.2.1