Example #1
0
def test_update_task():
    task_id = task_list.save_task({
        'description': "Do something worth updating",
        'status': "1"
    })
    task_list.update_task(task_id, description="This has been updated")
    task = task_list.get_task(task_id)
    assert "updated" in task['description']
    task_list.update_task(task_id, status="0")
    task = task_list.get_task(task_id)
    assert "0" in task['status']
Example #2
0
def get_mark_as_active(id):
    task_list.update_task(id, status="0")
    return get_task_list()
Example #3
0
def get_mark_as_completed(id):
    task_list.update_task(id, status="1")
    return get_task_list()
Example #4
0
def update_task(id):
    task = request.forms.get('task')
    name = request.forms.get('name')
    task_list.update_task(id, task, name)
    redirect('/')