def test_delete_all(self): users = yield User.all() ids = [user.id for user in users] for _ in range(3): yield User(first_name="blah").save() yield User.deleteAll(["first_name = ?", "blah"]) users = yield User.all() resultids = [user.id for user in users] self.assertEqual(resultids, ids)
def test_all(self): ids = [self.user.id] for _ in range(3): user = yield User(first_name="blah").save() ids.append(user.id) results = yield User.all() resultids = [result.id for result in results] self.assertEqual(ids, resultids)