'Regression test for #13902: When using a ManyToMany in list_filter,
results shouldn\'t appear more than once. Target of the relationship
inherits from another.'

def test_distinct_for_m2m_to_inherited_in_list_filter(self):

    lead = ChordsMusician.objects.create(name='Player    A')
    three = ChordsBand.objects.create(name='The    Chords    Trio')
    Invitation.objects.create(band=three, player=lead, instrument='guitar')
    Invitation.objects.create(band=three, player=lead, instrument='bass')
    m = ChordsBandAdmin(ChordsBand, custom_site)
    request = self.factory.get('/chordsband/', data={'members': lead.pk})
    cl = ChangeList(request, ChordsBand, *get_changelist_args(m))
    cl.get_results(request)
    self.assertEqual(cl.result_count, 1)
