def testAdd(self): keys = Keys() before_count = len(keys.all()) self.assertTrue(keys.add(keys.new(), persist=False)) after_count = len(keys.all()) self.assertGreater(after_count, before_count) self.assertEqual(before_count + 1, after_count)
def testInit(self): keys = Keys() self.assertIsInstance(keys, ModelCollection) self.assertGreater(keys._items, 0) self.assertIsInstance(keys.all(), list) for i in keys.all(): self.assertIsInstance(i, Key)