コード例 #1
0
ファイル: test_fk.py プロジェクト: wallneradam/tortoise-orm
 async def test_minimal__uninstantiated_iterate(self):
     tour = testmodels.Tournament(name="Team1")
     with self.assertRaisesRegex(
             OperationalError,
             "This objects hasn't been instanced, call .save()"):
         async for _ in tour.minrelations:
             pass
コード例 #2
0
ファイル: test_fk.py プロジェクト: wallneradam/tortoise-orm
 async def test_minimal__uninstantiated_create(self):
     tour = testmodels.Tournament(name="Team1")
     with self.assertRaisesRegex(OperationalError,
                                 "You should first call .save()"):
         await testmodels.MinRelation.create(tournament=tour)