Clean up unique on existing models

This commit is contained in:
Matthew Ryan Dillon 2016-06-16 06:45:59 -07:00
parent a44ac2fa81
commit 49eacdeef4
16 changed files with 141 additions and 12 deletions

View file

@ -39,6 +39,13 @@ class FlawTestCase(TestCase):
self.assertTrue(isinstance(f, Flaw))
self.assertEqual(f.__str__(), f.name)
def test_uniqueness(self):
f1 = FlawFactory()
with transaction.atomic(), self.assertRaises(IntegrityError):
FlawFactory(name=f1.name)
f3 = FlawFactory()
self.assertTrue(isinstance(f3, Flaw))
class ProcessingTestCase(TestCase):
def test_creation(self):