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