Пример #1
0
 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)
Пример #2
0
 def testFirst(self):
     keys = Keys()
     self.assertEqual(keys.first(), None)
     entity = keys.new()
     keys.add(entity, persist=False)
     self.assertEqual(keys.first(), entity)