

def test_select_related_using_get(self):
    with translation.override('en'):
        with self.assertNumQueries(1):
            r = SimpleRelated.objects.language().select_related('normal').get(translated_field='test1')
            self.assertEqual(r.normal.pk, self.normal_id[1])
            self.assertEqual(self.normal1.shared_field, r.normal.shared_field)
            self.assertEqual(self.normal1.translated_field, r.normal.translated_field)

dataset/ETHPy150Open KristianOellegaard/django-hvad/hvad/tests/related.py SelectRelatedTests.test_select_related_using_get/original