diff options
Diffstat (limited to 'tests/postgres_tests/test_json.py')
| -rw-r--r-- | tests/postgres_tests/test_json.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_json.py b/tests/postgres_tests/test_json.py index 78dded31a9..9691329a49 100644 --- a/tests/postgres_tests/test_json.py +++ b/tests/postgres_tests/test_json.py @@ -365,3 +365,13 @@ class TestFormField(PostgreSQLTestCase): field = CustomJSONField() self.assertIsInstance(field.widget, widgets.Input) + + def test_already_converted_value(self): + field = forms.JSONField(required=False) + tests = [ + '["a", "b", "c"]', '{"a": 1, "b": 2}', '1', '1.5', '"foo"', + 'true', 'false', 'null', + ] + for json_string in tests: + val = field.clean(json_string) + self.assertEqual(field.clean(val), val) |
