'Regression test for #13902: When using a ManyToMany in list_filter,
results shouldn\'t apper more than once. Basic ManyToMany.'

def test_distinct_for_m2m_in_list_filter(self):

    blues = Genre.objects.create(name='Blues')
    band = Band.objects.create(name='B.B.    King    Review', nr_of_members=11)
    band.genres.add(blues)
    band.genres.add(blues)
    m = BandAdmin(Band, admin.site)
    cl = ChangeList(MockFilteredRequestA(blues.pk), Band, m.list_display, m.list_display_links, m.list_filter, m.date_hierarchy, m.search_fields, m.list_select_related, m.list_per_page, m.list_editable, m)
    cl.get_results(MockFilteredRequestA(blues.pk))
    self.assertEqual(cl.result_count, 1)
