

def test_follow_inheritance(self):
    with self.assertNumQueries(1):
        stat = UserStat.objects.select_related('user', 'advanceduserstat').get(posts=200)
        self.assertEqual(stat.advanceduserstat.posts, 200)
        self.assertEqual(stat.user.username, 'bob')
    with self.assertNumQueries(1):
        self.assertEqual(self.advanceduserstat.user.username, 'bob')

dataset/ETHPy150Open django/django/tests/select_related_onetoone/tests.py ReverseSelectRelatedTestCase.test_follow_inheritance/VarMisuse@81/110 `stat`->`self`