

def test_deep_select_related_language_all(self):
    with translation.override('en'):
        with self.assertNumQueries(1):
            obj = RelatedRelated.objects.language('all').select_related('related__normal', 'simple__normal').filter(pk=self.relrel1.pk).get()
        with self.assertNumQueries(0):
            self.assertEqual(obj.related.pk, self.related1.pk)
            self.assertEqual(obj.related.normal.pk, self.normal_id[1])
            self.assertEqual(obj.related.normal.translated_field, NORMAL[1].translated_field['en'])
            self.assertEqual(obj.simple.pk, self.simplerel.pk)
            self.assertEqual(self.simple.translated_field, self.simplerel.translated_field)
            self.assertEqual(obj.simple.normal.pk, self.normal_id[1])
            self.assertEqual(obj.simple.normal.translated_field, NORMAL[1].translated_field['en'])

dataset/ETHPy150Open KristianOellegaard/django-hvad/hvad/tests/related.py DeepSelectRelatedTests.test_deep_select_related_language_all/VarMisuse@155/202 `obj`->`self`