

def test_default_field_with_assigning_model(self):
    mocked = mock.Mock()
    chained_call = '.'.join(['_default_manager', 'distinct.return_value', 'order_by.return_value', 'values_list.return_value'])
    mocked.configure_mock(**{
        chained_call: iter([]),
    })
    f = AllValuesFilter()
    f.model = mocked
    field = f.field
    self.assertIsInstance(field, forms.ChoiceField)

dataset/ETHPy150Open carltongibson/django-filter/tests/test_filters.py AllValuesFilterTests.test_default_field_with_assigning_model/original