示例#1
0
def remove_task(id):
    """
    Route to mark delete a task

    :param id: ID of task to be deleted
    :return: application page
    """
    delete_task(id)
    return redirect("/")
示例#2
0
def test_delete_task(test_app):
    create_task('Get Milk')
    assert len(get_tasks()) == 1

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

    assert len(get_tasks()) == 0
示例#3
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
def task_delete(task_id):
    # TODO: Delete task based on task_id
    delete_task(task_id)

    # Redirect user back to the main page, so the list of tasks will be updated
    return redirect("/")
示例#5
0
文件: test_api.py 项目: ygivenx/todo
def test_delete(test_app):
    add_task_to_db("delete test")
    delete_task(1)
    assert list_tasks() == []