I am running the below test:
from django.db import IntegrityError def testInvalidSubAndOutcodeCombination(self): with self.assertRaises(IntegrityError):