mirror of https://github.com/django/django.git
Added tests for ArrayField.has_changed().
This commit is contained in:
parent
3428be3cf9
commit
e67dc0fbb2
|
@ -753,6 +753,13 @@ class TestSimpleFormField(PostgreSQLTestCase):
|
|||
vals = ['a', 'b', 'c']
|
||||
self.assertEqual(field.clean(vals), vals)
|
||||
|
||||
def test_has_changed(self):
|
||||
field = SimpleArrayField(forms.IntegerField())
|
||||
self.assertIs(field.has_changed([1, 2], [1, 2]), False)
|
||||
self.assertIs(field.has_changed([1, 2], '1,2'), False)
|
||||
self.assertIs(field.has_changed([1, 2], '1,2,3'), True)
|
||||
self.assertIs(field.has_changed([1, 2], 'a,b'), True)
|
||||
|
||||
|
||||
class TestSplitFormField(PostgreSQLTestCase):
|
||||
|
||||
|
|
Loading…
Reference in New Issue