diff options
author | Claude Paroz <claude@2xlibre.net> | 2016-02-15 19:28:49 +0100 |
---|---|---|
committer | Claude Paroz <claude@2xlibre.net> | 2016-02-16 21:07:05 +0100 |
commit | 928c12eb1a75dbcab22b64f8cf0afb17389c20d2 (patch) | |
tree | b8f20f14e121e816772056d639a6a14f60adffe8 /tests/postgres_tests/test_json.py | |
parent | b09b71bf3468c67a9c08654e7aa8b99efe59ebee (diff) | |
download | django-928c12eb1a75dbcab22b64f8cf0afb17389c20d2.tar.gz |
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.
Diffstat (limited to 'tests/postgres_tests/test_json.py')
-rw-r--r-- | tests/postgres_tests/test_json.py | 6 |
1 files changed, 3 insertions, 3 deletions
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): |