Ejemplo n.º 1
0
 def testAdd(self):
     jail_types = JailTypes()
     before_count = len(jail_types.all())
     self.assertTrue(jail_types.add(jail_types.new(), persist=False))
     after_count = len(jail_types.all())
     self.assertGreater(after_count, before_count)
     self.assertEqual(before_count + 1, after_count)
Ejemplo n.º 2
0
    def testInit(self):
        jail_types = JailTypes()
        self.assertIsInstance(jail_types, ModelCollection)
        self.assertGreater(jail_types._items, 0)
        self.assertIsInstance(jail_types.all(), list)

        for i in jail_types.all():
            self.assertIsInstance(i, JailType)