

def test_filtering_on_required_skipped_when_len_of_value_is_len_of_field_choices(self):
    qs = mock.Mock(spec=[])
    f = MultipleChoiceFilter(name='somefield', required=True)
    f.always_filter = False
    result = f.filter(qs, [])
    self.assertEqual(len(f.field.choices), 0)
    self.assertEqual(qs, result)
    f.field.choices = ['some', 'values', 'here']
    result = f.filter(qs, ['some', 'values', 'here'])
    self.assertEqual(qs, result)
    result = f.filter(qs, ['other', 'values', 'there'])
    self.assertEqual(qs, result)

dataset/ETHPy150Open carltongibson/django-filter/tests/test_filters.py MultipleChoiceFilterTests.test_filtering_on_required_skipped_when_len_of_value_is_len_of_field_choices/original