'Regression test for #13902: When using a ManyToMany in list_filter,
results shouldn\'t appear more than once. Model managed in the
admin inherits from the one that defins the relationship.'

def test_distinct_for_inherited_m2m_in_list_filter(self):

    lead = Musician.objects.create(name='John')
    four = Quartet.objects.create(name='The    Beatles')
    Membership.objects.create(group=four, music=lead, role='lead    voice')
    Membership.objects.create(group=four, music=lead, role='guitar    player')
    m = QuartetAdmin(Quartet, custom_site)
    request = self.factory.get('/quartet/', data={'members': lead.pk})
    cl = ChangeList(request, Quartet, *get_changelist_args(m))
    cl.get_results(request)
    self.assertEqual(cl.result_count, 1)
