

def test_triple(self):
    normal1 = Normal.objects.language('en').get(pk=self.normal_id[1])
    many = normal1.manyrels.create(name='many1')
    with translation.override('en'):
        normals = Normal.objects.language().filter(manyrels__id=many.pk).order_by('translated_field')
        self.assertEqual([n.pk for n in normals], [normal1.pk])
        normals = many.normals.language()
        self.assertEqual([normal1.pk], [n.pk for n in normals])
        normals_plain = many.normals.all()
        self.assertEqual([normal1.pk], [n.pk for n in normals_plain])

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