

def test_select_related_language_all(self):
    with translation.override('en'):
        obj = SimpleRelated.objects.language().create(normal=objs.normal2, translated_field='test2_en')
        obj.translate('ja')
        obj.translated_field = 'test2_ja'
        obj.save()
        with self.assertNumQueries(1):
            objs = SimpleRelated.objects.language('all').filter(pk=obj.pk).order_by('language_code').select_related('normal')
            check = [(NORMAL[2].shared_field, NORMAL[2].translated_field['en']), (NORMAL[2].shared_field, NORMAL[2].translated_field['ja'])]
            self.assertEqual(list(((obj.normal.shared_field, obj.normal.translated_field) for obj in objs)), check)

dataset/ETHPy150Open KristianOellegaard/django-hvad/hvad/tests/related.py SelectRelatedTests.test_select_related_language_all/VarMisuse@34/44 `self`->`objs`