

def test_form_field_with_only_one_value(self):
    form = SortedForm({
        'values': '',
    })
    self.assertEqual(len(form.errors), 0)
    form = SortedForm({
        'values': str(self.a.pk),
    })
    self.assertEqual(len(form.errors), 0)
    form = SortedForm({
        'values': '{a.pk},{b.pk}'.format(a=self.a, b=self.b),
    })
    self.assertEqual(len(form.errors), 0)

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