def test_distinct_for_non_unique_related_object_in_list_filter(self):
        parent = Parent.objects.create(name='Mary')
        # Two children with the same name
        Child.objects.create(parent=parent, name='Daniel')
        Child.objects.create(parent=parent, name='Daniel')

        m = ParentAdmin(Parent, admin.site)
        request = self.factory.get('/parent/', data={'child__name': 'Daniel'})

        cl = ChangeList(request, Parent, 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_max_show_all, m.list_editable, m)

        # Make sure distinct() was called
        self.assertEqual(cl.queryset.count(), 1)
Test starting a customer on a drip campaign.
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/tests/admin_changelist/tests.py/ChangeListTests.test_distinct_for_non_unique_related_object_in_list_filter--crossover with--dataset/ETHPy150Open sendwithus/sendwithus_python/sendwithus/test/__init__.py/TestAPI.test_start_on_disabled_drip_campaign