Пример #1
0
 async def test_insert_many(self, project_id):
     f1 = models.Project(name="f1")
     f2 = models.Project(name="f2")
     f3 = models.Project(name="f3")
     ids = await models.Project.insert_many([f1, f2, f3])
     assert len(ids) == 3
     assert all([await models.Project.exists(i) for i in ids])
Пример #2
0
 async def test_insert_many(self, project_id):
     p1 = models.Project(name="p1")
     p2 = models.Project(name="p2")
     p3 = models.Project(name="p3")
     ids = await models.Project.insert_many([p1, p2, p3])
     assert len(ids) == 3
     assert all([await models.Project.where(id=i).first() for i in ids])