Exemple #1
0
def test_vote_to_comment():
    user = User("a")
    comment = Comment("dummy")
    assert comment.receive_vote_from(user) == user.vote_to_comment(comment)
Exemple #2
0
def test_receive_vote_from():
    comment1 = Comment(body, voted_users)
    accept = voted_users + ["cccc"]
    comment1.receive_vote_from("cccc")
    assert comment1.voted_users == accept
Exemple #3
0
def test_modify():
    comment1 = Comment("a")
    comment1.modify_body("b")
    assert comment1.body == "b"
    assert comment1.modified_at is not None
Exemple #4
0
def test_vote_count():
    comment1 = Comment(body, voted_users)
    assert comment1.vote_count() == len(voted_users)