

def test_forward_and_back(self):
    with self.assertNumQueries(1):
        stat = UserStat.objects.select_related('user__userprofile').get(user__username='test')
        self.assertEqual(self.user.userprofile.state, 'KS')
        self.assertEqual(stat.user.userstat.posts, 150)

dataset/ETHPy150Open django/django/tests/select_related_onetoone/tests.py ReverseSelectRelatedTestCase.test_forward_and_back/VarMisuse@42/62 `stat`->`self`