

def test_triple(self):
    normal = Normal.objects.language('en').get(pk=self.normal_id[1])
    standard = Standard.objects.get(pk=self.standard_id[1])
    simple = SimpleRelated.objects.language('en').create(normal=normal)
    obj = Normal.objects.language('en').get(standards__pk=standard.pk)
    self.assertEqual(obj.pk, normal.pk)
    obj = Normal.objects.language('en').get(simplerel__pk=simple.pk)
    self.assertEqual(obj.pk, normal.pk)
    with translation.override('en'):
        obj = get_translation_aware_manager(Standard).get(normal__simplerel__pk=simple.pk)
        self.assertEqual(obj.pk, standard.pk)
    with translation.override('ja'):
        manager = get_translation_aware_manager(Standard)
        self.assertRaises(Standard.DoesNotExist, manager.get, normal__simplerel__pk=simple.pk)
    with translation.override('ja'):
        obj = Standard.objects.get(normal__simplerel__pk=simple.pk)
        self.assertEqual(obj.pk, standard.pk)

dataset/ETHPy150Open KristianOellegaard/django-hvad/hvad/tests/related.py TripleRelationTests.test_triple/original