

def test_empty_field(self):
    form = SortedForm({
        'values': [],
    })
    self.assertTrue(form.is_valid())
    self.assertFalse(form.cleaned_data['values'])

dataset/ETHPy150Open gregmuellegger/django-sortedm2m/sortedm2m_tests/test_forms.py TestSortedFormField.test_empty_field/original