def _outer(self, fail_outer=False, fail_inner=False): with test_db.savepoint(): User.create(username='******') try: self._inner(fail_inner) except ValueError: pass if fail_outer: raise ValueError
def _inner(self, fail_inner): with test_db.savepoint(): User.create(username='******') if fail_inner: raise ValueError('failing')
def _trigger_exc(): with test_db.savepoint() as s1: fb = FKC_b.create(fkc_a=-1000)