示例#1
0
文件: tests.py 项目: ucldc/avram
 def testCampusSlugStartsWithUC(self):
     c = Campus()
     c.name = "test"
     c.slug = "test"
     self.assertRaises(ValueError, c.save)
     c.slug = "UCtest"
     c.save()
     self.assertTrue(hasattr(c, "ark"))
     self.assertTrue(hasattr(c, "google_analytics_tracking_code"))
示例#2
0
文件: tests.py 项目: ucldc/avram
 def testNoDupArks(self):
     """Need to programatically check that the arks are unique.
     Due to the need for blank arks (django weird char null), we can't
     use the DB unique property.
     """
     c = Campus()
     c.name = "test"
     c.slug = "UCtest"
     c.ark = "ark:/13030/tf0p3009mq"
     self.assertRaises(ValueError, c.save)
     try:
         c.save()
     except ValueError, e:
         self.assertEqual(e.args, ("Campus with ark ark:/13030/tf0p3009mq already exists",))
示例#3
0
文件: tests.py 项目: ucldc/avram
 def setUp(self):
     c = Campus()
     c.name = "New Test Campus"
     c.slug = "NTC"
     c.order = 200
     self.assertRaises(ValueError, c.save)