views_test.py 文件源码

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

项目:annotran 作者: BirkbeckCTP 项目源码 文件源码
def test_add_vote_to_db_authenticated_user_objects_none():
    """
        This should raise HTTPNotFound as all page, author, voter, group, and language are None.
    """
    request = _mock_request(matchdict={'page_uri': 'http://www.annotran_test.com',
                                       'public_group_id': "12345",
                                       'public_language_id': "12345",
                                       'score': 5,
                                       'username':"test_username"},
                            authenticated_user=mock.Mock(id=2, username="test2", uid="test2"))
    with pytest.raises(httpexceptions.HTTPNotFound):
        views.add_vote(request)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号