diff options
author | Vinay Karanam <vinayinvicible@gmail.com> | 2018-01-03 12:10:14 +0530 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2018-04-07 17:53:33 -0400 |
commit | 6a1957bb9887f8e0bb69d3d2b180a1414d38c1fc (patch) | |
tree | 911f7e0a8cdaad23601a4bb12f6b28bf8c1766b0 /tests/postgres_tests/test_array.py | |
parent | e67dc0fbb2fc3d7c2c503b4cdc5b77ce4e944066 (diff) | |
download | django-6a1957bb9887f8e0bb69d3d2b180a1414d38c1fc.tar.gz |
Fixed #28950 -- Fixed ArrayField.has_changed() for empty values.
Diffstat (limited to 'tests/postgres_tests/test_array.py')
-rw-r--r-- | tests/postgres_tests/test_array.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index 71d0603469..cc264fe9fc 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -760,6 +760,14 @@ class TestSimpleFormField(PostgreSQLTestCase): self.assertIs(field.has_changed([1, 2], '1,2,3'), True) self.assertIs(field.has_changed([1, 2], 'a,b'), True) + def test_has_changed_empty(self): + field = SimpleArrayField(forms.CharField()) + self.assertIs(field.has_changed(None, None), False) + self.assertIs(field.has_changed(None, ''), False) + self.assertIs(field.has_changed(None, []), False) + self.assertIs(field.has_changed([], None), False) + self.assertIs(field.has_changed([], ''), False) + class TestSplitFormField(PostgreSQLTestCase): |