Ticket #30596: test-30596.diff

File test-30596.diff, 861 bytes (added by Mariusz Felisiak, 5 years ago)

Test.

  • tests/postgres_tests/test_array.py

    diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py
    index d7ed5223e3..f59c3a729f 100644
    a b class TestSplitFormField(PostgreSQLSimpleTestCase):  
    909909        obj = form.save(commit=False)
    910910        self.assertEqual(obj.field, [1, 2])
    911911
     912    def test_splitarrayfield_has_changed(self):
     913        class Form(forms.ModelForm):
     914            field = SplitArrayField(forms.IntegerField(), required=False, size=2)
     915
     916            class Meta:
     917                model = IntegerArrayModel
     918                fields = ('field',)
     919        obj = IntegerArrayModel(field=[1, 2])
     920        form = Form({'field_0': '1', 'field_1': '2'}, instance=obj)
     921        self.assertFalse(form.has_changed())
     922
    912923
    913924class TestSplitFormWidget(PostgreSQLWidgetTestCase):
    914925
Back to Top