コード例 #1
0
def task_to_project(task_id):
    uid = current_user.get_obj_id()
    project = TaskRepo.task_to_project(task_id, uid)
    if not project:
        return json.dumps({"success": False})
    else:
        return json.dumps({"success": True, "data": project})
コード例 #2
0
ファイル: test_repo.py プロジェクト: sirrah23/GTDApp
def test_task_to_project(resource):
    user_id = resource
    task = TaskRepo.add_task(description="Thing", user=user_id)
    project = TaskRepo.task_to_project(task["id"], user_id)
    # No more tasks
    assert len(TaskRepo.get_all_tasks()) == 0
    # Project used to be the task
    assert project is not None
    assert project["description"] == "Thing"