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)