

def test_relation(self):
    en = Normal.objects.language('en').get(pk=self.normal_id[1])
    ja = Normal.objects.language('ja').get(pk=self.normal_id[1])
    with translation.override('en'):
        related = Standard.objects.get(pk=self.standard_id[1])
        self.assertEqual(related.normal.pk, en.pk)
        self.assertEqual(related.normal.shared_field, en.shared_field)
        self.assertEqual(related.normal.translated_field, en.translated_field)
        self.assertTrue((related in en.standards.all()))
    with translation.override('ja'):
        related = Standard.objects.get(pk=self.standard_id[1])
        self.assertEqual(related.normal.pk, ja.pk)
        self.assertEqual(related.normal.shared_field, ja.shared_field)
        self.assertEqual(related.normal.translated_field, ja.translated_field)
        self.assertTrue((related in ja.standards.all()))

dataset/ETHPy150Open KristianOellegaard/django-hvad/hvad/tests/related.py StandardToTransFKTest.test_relation/original