Exemple #1
0
 def testRepositoryNoDupArks(self):
     """Check that the Repostiories can't have duplicate arks.
     Again, since it is a char & we allow blank, can't use db unique
     check"""
     r = Repository()
     r.name = "test repo"
     r.ark = "fakeARK"
     r.save()
     r2 = Repository()
     r2.name = "test repo"
     r2.ark = "fakeARK"
     self.assertRaises(ValueError, r2.save)
     try:
         r2.save()
     except ValueError, e:
         self.assertEqual(e.args, ("Unit with ark fakeARK already exists",))