'Regressions tests for #15819: If a field listed in list_filters
is a non-unique related object, distinct() must be called.'

def test_distinct_for_non_unique_related_object_in_list_filter(self):

    parent = Parent.objects.create(name='Mary')
    Child.objects.create(parent=parent, name='Daniel')
    Child.objects.create(parent=parent, name='Daniel')
    m = ParentAdmin(Parent, custom_site)
    request = self.factory.get('/parent/', data={'child__name': 'Daniel'})
    cl = ChangeList(request, Parent, *get_changelist_args(m))
    self.assertEqual(cl.queryset.count(), 1)
