test_ajax_add_things.py 文件源码

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

项目:dbas 作者: hhucn 项目源码 文件源码
def test_set_new_issue(self):
        self.config.testing_securitypolicy(userid='Tobias', permissive=True)
        from dbas.views import set_new_issue as ajax
        request = testing.DummyRequest(params={
            'info': 'Some new info',
            'long_info': 'Some new long info',
            'title': 'Some new title',
            'lang': 'en',
            'is_public': 'False',
            'is_read_only': 'False'
        }, matchdict={})
        response = ajax(request)
        self.assertIsNotNone(response)
        self.assertTrue(len(response['error']) == 0)
        self.assertEqual(len(DBDiscussionSession.query(Issue).filter_by(title='Some new title').all()), 1)
        DBDiscussionSession.query(Issue).filter_by(title='Some new title').delete()
        transaction.commit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号