

def test_back_and_forward(self):
    with self.assertNumQueries(1):
        u = User.objects.select_related('userstat').get(username='test')
        self.assertEqual(u.userstat.user.username, 'test')

dataset/ETHPy150Open django/django/tests/select_related_onetoone/tests.py ReverseSelectRelatedTestCase.test_back_and_forward/original