コード例 #1
0
ファイル: test_comment.py プロジェクト: bkuzmic/timelessis-1
def test_get_not_found_comment(app):
    with app.test_request_context(
        "commentview",
        data = {"comment_id" : 100}
    ):
        commentview = CommentView()
        commentview.model = FakeComment
    with pytest.raises(NotFound):
        commentview.get()
コード例 #2
0
def test_get_found_comment(app):
    with app.test_request_context("commentview", data={"comment_id": 5}):
        commentview = CommentView()
        commentview.model = FakeComment
        result = commentview.get()
    assert result[
        0] == found_comment, "Wrong comment returned from CommentView"
    assert result[1] == HTTPStatus.OK, "Wrong status returned from CommentView"