

def test_filtering_uses_distinct(self):
    qs = mock.Mock(spec=['filter', 'distinct'])
    f = Filter(name='somefield', distinct=True)
    f.filter(qs, 'value')
    result = qs.distinct.assert_called_once_with()
    self.assertNotEqual(qs, result)

dataset/ETHPy150Open carltongibson/django-filter/tests/test_filters.py FilterTests.test_filtering_uses_distinct/original