def test__crashes_if_hooks_exist_before_entering_transaction(self):
post_commit(lambda failure: None)
decorated_function = orm.transactional(lambda: None)
self.assertRaises(TransactionManagementError, decorated_function)
# The hook list is cleared so that the exception is raised only once.
self.assertThat(post_commit_hooks.hooks, HasLength(0))
评论列表
文章目录