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
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)
async def test_minimal__uninstantiated_await(self): tour = testmodels.Tournament(name='Team1') with self.assertRaisesRegex( OperationalError, "This objects hasn't been instanced, call .save()"): await tour.minrelations