Beispiel #1
0
def complete_task(id):
    """
    Route to mark a task complete

    :param id: ID for task to be completed
    :return: application page
    """
    finish_task(id)
    return redirect("/")
Beispiel #2
0
def test_list_tasks(task_body):
    n = len(get_tasks())
    task = create_task(task_body)
    # Make sure we have 1 more task now
    assert len(get_tasks()) == n + 1
    assert not task.done
    finish_task(task.id)
    assert task.done
    delete_task(task.id)
    assert len(get_tasks()) == n
Beispiel #3
0
def test_finish_task(test_app):
    create_task('Get Milk')
    assert len(get_tasks()) == 1

    get_milk = get_tasks().pop()
    get_milk_id = get_milk.id
    finish_task(get_milk_id)

    get_milk = get_tasks().pop()
    assert get_milk.done is True
def task_done(task_id):
    # TODO: Mark task as done using task_id
    finish_task(task_id)

    return redirect("/")
Beispiel #5
0
def test_finish_task(test_app):
    add_task_to_db("finish this now")
    finish_task(1)
    assert list_tasks()[0].done is not False
Beispiel #6
0
def task_done(task_id):
    """Mark task as done using task_id"""
    finish_task(task_id)

    return redirect("/")