'When passing proxy model objects, child objects, or parent objects,
lookups work fine.'

def test_correct_lookup(self):

    out_a = ['<ObjectA:    oa>']
    out_b = ['<ObjectB:    ob>', '<ObjectB:    pob>']
    out_c = ['<ObjectC:    >']
    self.assertQuerysetEqual(ObjectB.objects.filter(objecta=self.poa).order_by('name'), out_b)
    self.assertQuerysetEqual(ObjectA.objects.filter(objectb__in=self.pob).order_by('pk'), (out_a * 2))
    self.assertQuerysetEqual(ObjectB.objects.filter(objecta__in=[self.coa]), [])
    self.assertQuerysetEqual(ObjectB.objects.filter(objecta__in=[self.poa, self.coa]).order_by('name'), out_b)
    self.assertQuerysetEqual(ObjectB.objects.filter(objecta__in=iter([self.poa, self.coa])).order_by('name'), out_b)
    self.assertQuerysetEqual(ObjectC.objects.exclude(childobjecta=self.oa), out_c)
    with self.assertNumQueries(0):
        ObjectB.objects.filter(objecta__in=ObjectA.objects.all())
