

def test_parent_only(self):
    with self.assertNumQueries(1):
        p = Parent1.objects.select_related('child1').get(name1='Only Parent1')
    with p.assertNumQueries(0):
        with self.assertRaises(Child1.DoesNotExist):
            p.child1

dataset/ETHPy150Open django/django/tests/select_related_onetoone/tests.py ReverseSelectRelatedTestCase.test_parent_only/VarMisuse@40/57 `self`->`p`