

def test_one_to_one_multi_prefetch_related(self):
    with self.assertNumQueries(2):
        poolstyles = list(PoolStyle.objects.prefetch_related('pool').order_by('pk'))
        self.assertIs(poolstyles[0], poolstyles[0].pool.poolstyle)
        self.assertIs(poolstyles[1], poolstyles[1].pool.poolstyle)

dataset/ETHPy150Open django/django/tests/known_related_objects/tests.py ExistingRelatedInstancesTests.test_one_to_one_multi_prefetch_related/original