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()
评论列表
文章目录