test_orm.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:maas 作者: maas 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号