コード例 #1
0
def test_get_root_parent_id_for_answer_comment():
    question = Post(id=1, post_type_id=Post.QUESTION)
    answer = Post(id=2, post_type_id=Post.ANSWER, parent=question)
    comment = Post(id=3, post_type_id=Post.COMMENT, parent=answer)
    assert 1 == comment.get_root_parent_id()
コード例 #2
0
def test_get_root_parent_id_for_answer():
    question = Post(id=1, post_type_id=Post.QUESTION)
    answer = Post(id=2, post_type_id=Post.ANSWER, parent=question)
    assert 1 == answer.get_root_parent_id()
コード例 #3
0
def test_get_root_parent_id_for_question_comment():
    question = Post(id=1, post_type_id=Post.QUESTION)
    comment = Post(id=2, post_type_id=Post.COMMENT, parent=question)
    assert 1 == comment.get_root_parent_id()
コード例 #4
0
def test_get_root_parent_id_for_question():
    question = Post(id=1, post_type_id=Post.QUESTION)
    assert 1 == question.get_root_parent_id()