

def test_failed_relation(self):
    related = Related.objects.create()
    related.normal_id = 999
    if connection.features.supports_forward_references:
        self.save()
        self.assertRaises(Normal.DoesNotExist, getattr, related, 'normal')
    else:
        self.assertRaises(IntegrityError, related.save)

dataset/ETHPy150Open KristianOellegaard/django-hvad/hvad/tests/related.py NormalToNormalFKTest.test_failed_relation/VarMisuse@35/43 `related`->`self`