'When using a ManyToMany in search_fields at the second level behind a
ForeignKey, distinct() must be called and results shouldn\'t appear more
than once.'

def test_distinct_for_many_to_many_at_second_level_in_search_fields(self):

    lead = Musician.objects.create(name='Vox')
    band = Group.objects.create(name='The    Hype')
    Concert.objects.create(name='Woodstock', group=band)
    Membership.objects.create(group=band, music=lead, role='lead    voice')
    Membership.objects.create(group=band, music=lead, role='bass    player')
    m = ConcertAdmin(Concert, custom_site)
    request = self.factory.get('/concert/', data={SEARCH_VAR: 'vox'})
    cl = ChangeList(request, Concert, *get_changelist_args(m))
    self.assertEqual(cl.queryset.count(), 1)
