示例#1
0
def test_has_children_handles_no_project_set():
    """ When no project is set, hasChildren should return False """
    # Given
    model = TreeModel()

    # Then
    assert model.hasChildren(QModelIndex()) is False
示例#2
0
def test_has_children_handles_plan_index():
    """ When no project is set, hasChildren should return False """
    # Given
    model = TreeModel()
    project = ResearchProject("")
    project.add_plan().add_task()
    model.set_project(project)

    # Then
    assert model.hasChildren(model.index(0, 0, model.plans_index)) is True