diff --git a/app/__init__.py b/app/__init__.py index 2764c4cc8..b649b8056 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -15,8 +15,10 @@ def create_app(test_config=None): app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False if test_config is None: - app.config["SQLALCHEMY_DATABASE_URI"] = os.environ.get( - "SQLALCHEMY_DATABASE_URI") + app.config["SQLALCHEMY_DATABASE_URI"] = os.environ.get("RENDER_DB_URI") + + # app.config["SQLALCHEMY_DATABASE_URI"] = os.environ.get( + # "SQLALCHEMY_DATABASE_URI") else: app.config["TESTING"] = True app.config["SQLALCHEMY_DATABASE_URI"] = os.environ.get( @@ -30,5 +32,9 @@ def create_app(test_config=None): migrate.init_app(app, db) # Register Blueprints here + from .routes import task_list_bp + app.register_blueprint(task_list_bp) + from .routes import goals_bp + app.register_blueprint(goals_bp) return app diff --git a/app/models/goal.py b/app/models/goal.py index b0ed11dd8..6afa241a5 100644 --- a/app/models/goal.py +++ b/app/models/goal.py @@ -2,4 +2,26 @@ class Goal(db.Model): - goal_id = db.Column(db.Integer, primary_key=True) + goal_id = db.Column(db.Integer, primary_key=True, autoincrement=True) + title = db.Column(db.String) + tasks = db.relationship("Task", back_populates="goal", lazy=True) + + + + + @classmethod + def from_dict(cls, goal_data): + new_goal = Goal( + title=goal_data["title"] + ) + + return new_goal + + + + + + def to_dict_goal(self): + return{ "goal": { + "id":self.goal_id, + "title":self.title}} \ No newline at end of file diff --git a/app/models/task.py b/app/models/task.py index c91ab281f..6ee9749a3 100644 --- a/app/models/task.py +++ b/app/models/task.py @@ -2,4 +2,41 @@ class Task(db.Model): - task_id = db.Column(db.Integer, primary_key=True) + task_id = db.Column(db.Integer, primary_key=True, autoincrement=True) + title = db.Column(db.String) #when refactoring change to varchar + description = db.Column(db.String) # when refacoring change to varvhar + completed_at = db.Column(db.DateTime, default=None, nullable=True) + goal_id = db.Column(db.Integer, db.ForeignKey('goal.goal_id')) + goal = db.relationship("Goal", back_populates="tasks") + + + @classmethod + def from_dict(cls, task_data): + new_task = Task( + title=task_data["title"], + description=task_data["description"], + completed_at=task_data["completed_at"] + ) + + return new_task + + + + + + def to_dict(self): + return{"task": { + "id":self.task_id, + "title":self.title, + "description":self.description, + "is_complete": True if self.completed_at else False}} +# wave 1 +#Our task list API should be able to work with an entity called Task. +# Tasks are entities that describe a task a user wants to complete. They contain a: +# title to name the task +# description to hold details about the task +# an optional datetime that the task is completed on +# Our goal for this wave is to be able to create, read, update, and delete different tasks. +# We will create RESTful routes for this different operations. + + diff --git a/app/routes.py b/app/routes.py index 3aae38d49..54dc8a5e5 100644 --- a/app/routes.py +++ b/app/routes.py @@ -1 +1,245 @@ -from flask import Blueprint \ No newline at end of file +from app import db +from app.models.task import Task +from app.models.goal import Goal +from flask import Blueprint, jsonify, make_response, request, abort +from datetime import datetime +import requests +import json +from dotenv import load_dotenv +import os + +load_dotenv() +task_list_bp = Blueprint("task_list", __name__, url_prefix="/tasks") +goals_bp = Blueprint("goals_list", __name__, url_prefix="/goals") +#validating the task_id +def validate_task(task_id): + try: + task_id = int(task_id) + except: + abort(make_response({"message": f"Task {task_id} invalid"}, 400)) + task = Task.query.get(task_id) + if not task: + abort(make_response({"details": "Invalid Data"}, 404)) + return task + +#validate goal_id +def validate_goal(goal_id): + try: + goal_id = int(goal_id) + except: + abort(make_response({"message": f"Goal {goal_id} invalid"}, 400)) + goal = Goal.query.get(goal_id) + if not goal: + abort(make_response({"details": "Invalid Data"}, 404)) + return goal + +# create tasks +@task_list_bp.route("", methods=["POST"]) +def post_task(): + request_body = request.get_json() + if "title" not in request_body or "description" not in request_body: + return make_response({"details": "Invalid data"}, 400) + new_task = Task( + title = request_body["title"], + description = request_body["description"], + # completed_at = request_body["completed_at"] + ) + db.session.add(new_task) + db.session.commit() + return jsonify({ + "task": { + "id": new_task.task_id, + "title": new_task.title, + "is_complete": False, + "description": new_task.description + } + }), 201 + +#create goals +@goals_bp.route("", methods=["POST"]) +def post_goal(): + request_body = request.get_json() + if "title" not in request_body: + return make_response({"details": "Invalid data"}, 400) + new_goal = Goal( + title = request_body["title"] + ) + db.session.add(new_goal) + db.session.commit() + return jsonify({ + "goal": { + "id": new_goal.goal_id, + "title": new_goal.title} }), 201 +# create nested post +@goals_bp.route("//tasks", methods=["POST"]) +def create_task(goal_id): + goal = validate_goal(goal_id) + request_body = request.get_json() + result = {"id": goal.goal_id, + "task_ids": request_body["task_ids"] +} + for task_id in request_body["task_ids"]: + task = validate_task(task_id) + goal.tasks.append(task) + db.session.commit() + return result + +# create nested get, singular goal, with its many tasks +@goals_bp.route("/tasks", methods=["GET"]) +def get_tasks_one_goal(goal_id): + goal = validate_goal(goal_id) + task_response = [] + + + + for task in goal.tasks: + if not task.completed_at: + task_response.append({ + "id": task.task_id, + "goal_id":goal.goal_id, + "title":task.title, + "description": task.description, + "is_complete": False + + }) + else: + task_response.append({ + "id": task.task_id, + "goal_id": goal.goal_id, + "title": task.title, + "description": task.description, + "completed_at":task.completed_at + }) + return jsonify({ + "id": goal.goal_id, + "title": goal.title, + "tasks": task_response}) +# #read all tasks +@task_list_bp.route("", methods=["GET"]) +def get_all_tasks(): + task_response = [] + sort_query = request.args.get("sort") + if sort_query == 'asc': + tasks = Task.query.order_by(Task.title).all() + elif sort_query == 'desc': + tasks = Task.query.order_by(Task.title.desc()).all() + else: + tasks = Task.query.all() + for task in tasks: + if not task.completed_at: + task_response.append({"id":task.task_id, + "title":task.title, + "description": task.description, + "is_complete": False + + }) + else: + task_response.append({ + "id":task.task_id, + "title":task.title, + "description": task.description, + "completed_at":task.completed_at + }) + return jsonify(task_response) + +#read all goals +@goals_bp.route("", methods=["GET"]) +def read_all_goals(): + goal_response = [] + goals = Goal.query.all() + + for goal in goals: + if not goals: + return jsonify(goal_response) + else: + goal_response.append({ + "id":goal.goal_id, + "title":goal.title}) + + return jsonify(goal_response) +#read one task/ read if empty task. +@task_list_bp.route("/", methods=["GET"]) +def get_one_task(task_id): + task = validate_task(task_id) + # goal = validate_goal(goal_id) + + if task.goal_id: + return{"task": { + "id":task.task_id, + "goal_id": task.goal_id, + "title":task.title, + "description":task.description, + "is_complete": True if task.completed_at else False}} + else: + return task.to_dict() +#read one goal +@goals_bp.route("/", methods=["GET"]) +def get_one_goal(goal_id): + goal = validate_goal(goal_id) + + + return jsonify({"goal":{"id": goal.goal_id, + "title":goal.title}}) +# #update task +@task_list_bp.route("/", methods=["PUT"]) +def update_task(task_id): + + task = validate_task(task_id) + request_body = request.get_json() + task.title = request_body["title"] + task.description = request_body["description"] + db.session.commit() + return task.to_dict() + +#update goal +@goals_bp.route("/", methods=["PUT"]) +def update_goal(goal_id): + goal = validate_goal(goal_id) + request_body = request.get_json() + goal.title = request_body["title"] + db.session.commit + return goal.to_dict_goal() + +#mark_complete endpoint with slack api implementation +@task_list_bp.route("//mark_complete", methods=["PATCH"]) +def update_task_to_complete(task_id): + task = validate_task(task_id) + task.completed_at = datetime.now() + #slack implementation + url = "https://slack.com/api/chat.postMessage" + payload = json.dumps({ + "channel": "C0581AUJACV", + "text": (f"Someone just completed the task {task.title}") + }) + headers = { + 'Authorization': os.environ.get("SLACK_API_TOKEN"), + 'Content-Type': 'application/json' + } + response = requests.request("POST", url, headers=headers, data=payload) + print(response.text) + db.session.commit() + return task.to_dict(), 200 + +#mark_incomplete endpoint +@task_list_bp.route("//mark_incomplete", methods=["PATCH"]) +def update_task_to_incomplete(task_id): + task = validate_task(task_id) + task.completed_at = None + db.session.commit() + return task.to_dict() + +# delete task +@task_list_bp.route("/", methods=["DELETE"]) +def delete_task(task_id): + task = validate_task(task_id) + db.session.delete(task) + db.session.commit() + return abort(make_response({"details":f"Task {task.task_id} \"{task.title}\" successfully deleted"})) + +#delete goal: +@goals_bp.route("/", methods=["DELETE"]) +def delete_goal(goal_id): + goal = validate_goal(goal_id) + db.session.delete(goal) + db.session.commit() + return abort(make_response({"details":f"Goal {goal.goal_id} \"{goal.title}\" successfully deleted"})) \ No newline at end of file diff --git a/tests/test_wave_01.py b/tests/test_wave_01.py index dca626d78..7bf967ab1 100644 --- a/tests/test_wave_01.py +++ b/tests/test_wave_01.py @@ -2,7 +2,7 @@ import pytest -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_tasks_no_saved_tasks(client): # Act response = client.get("/tasks") @@ -13,7 +13,7 @@ def test_get_tasks_no_saved_tasks(client): assert response_body == [] -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_tasks_one_saved_tasks(client, one_task): # Act response = client.get("/tasks") @@ -32,7 +32,7 @@ def test_get_tasks_one_saved_tasks(client, one_task): ] -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_task(client, one_task): # Act response = client.get("/tasks/1") @@ -51,7 +51,7 @@ def test_get_task(client, one_task): } -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this featgit ure yet") def test_get_task_not_found(client): # Act response = client.get("/tasks/1") @@ -59,14 +59,10 @@ def test_get_task_not_found(client): # Assert assert response.status_code == 404 + assert response_body == {"details": "Invalid Data"} + - raise Exception("Complete test with assertion about response body") - # ***************************************************************** - # **Complete test with assertion about response body*************** - # ***************************************************************** - - -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_create_task(client): # Act response = client.post("/tasks", json={ @@ -93,7 +89,7 @@ def test_create_task(client): assert new_task.completed_at == None -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_update_task(client, one_task): # Act response = client.put("/tasks/1", json={ @@ -119,7 +115,7 @@ def test_update_task(client, one_task): assert task.completed_at == None -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_update_task_not_found(client): # Act response = client.put("/tasks/1", json={ @@ -130,14 +126,12 @@ def test_update_task_not_found(client): # Assert assert response.status_code == 404 + assert response_body == {"details": "Invalid Data"} + - raise Exception("Complete test with assertion about response body") - # ***************************************************************** - # **Complete test with assertion about response body*************** - # ***************************************************************** -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_delete_task(client, one_task): # Act response = client.delete("/tasks/1") @@ -152,7 +146,7 @@ def test_delete_task(client, one_task): assert Task.query.get(1) == None -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_delete_task_not_found(client): # Act response = client.delete("/tasks/1") @@ -160,16 +154,11 @@ def test_delete_task_not_found(client): # Assert assert response.status_code == 404 - - raise Exception("Complete test with assertion about response body") - # ***************************************************************** - # **Complete test with assertion about response body*************** - # ***************************************************************** - + assert response_body == {'details': 'Invalid Data'} assert Task.query.all() == [] -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_create_task_must_contain_title(client): # Act response = client.post("/tasks", json={ @@ -186,7 +175,7 @@ def test_create_task_must_contain_title(client): assert Task.query.all() == [] -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_create_task_must_contain_description(client): # Act response = client.post("/tasks", json={ diff --git a/tests/test_wave_02.py b/tests/test_wave_02.py index a087e0909..651e3aebd 100644 --- a/tests/test_wave_02.py +++ b/tests/test_wave_02.py @@ -1,7 +1,7 @@ import pytest -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_tasks_sorted_asc(client, three_tasks): # Act response = client.get("/tasks?sort=asc") @@ -29,7 +29,7 @@ def test_get_tasks_sorted_asc(client, three_tasks): ] -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_tasks_sorted_desc(client, three_tasks): # Act response = client.get("/tasks?sort=desc") diff --git a/tests/test_wave_03.py b/tests/test_wave_03.py index 32d379822..917c6e0d4 100644 --- a/tests/test_wave_03.py +++ b/tests/test_wave_03.py @@ -5,7 +5,7 @@ import pytest -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_mark_complete_on_incomplete_task(client, one_task): # Arrange """ @@ -42,7 +42,7 @@ def test_mark_complete_on_incomplete_task(client, one_task): assert Task.query.get(1).completed_at -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_mark_incomplete_on_complete_task(client, completed_task): # Act response = client.patch("/tasks/1/mark_incomplete") @@ -62,7 +62,7 @@ def test_mark_incomplete_on_complete_task(client, completed_task): assert Task.query.get(1).completed_at == None -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_mark_complete_on_completed_task(client, completed_task): # Arrange """ @@ -99,7 +99,7 @@ def test_mark_complete_on_completed_task(client, completed_task): assert Task.query.get(1).completed_at -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_mark_incomplete_on_incomplete_task(client, one_task): # Act response = client.patch("/tasks/1/mark_incomplete") @@ -119,7 +119,7 @@ def test_mark_incomplete_on_incomplete_task(client, one_task): assert Task.query.get(1).completed_at == None -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_mark_complete_missing_task(client): # Act response = client.patch("/tasks/1/mark_complete") @@ -127,14 +127,10 @@ def test_mark_complete_missing_task(client): # Assert assert response.status_code == 404 + assert response_body == {"details": "Invalid Data"}, 404 - raise Exception("Complete test with assertion about response body") - # ***************************************************************** - # **Complete test with assertion about response body*************** - # ***************************************************************** - -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_mark_incomplete_missing_task(client): # Act response = client.patch("/tasks/1/mark_incomplete") @@ -143,7 +139,8 @@ def test_mark_incomplete_missing_task(client): # Assert assert response.status_code == 404 - raise Exception("Complete test with assertion about response body") - # ***************************************************************** - # **Complete test with assertion about response body*************** - # ***************************************************************** + # raise Exception("Complete test with assertion about response body") + # # ***************************************************************** + # # **Complete test with assertion about response body*************** + # # ***************************************************************** + assert response_body == {"details": "Invalid Data"}, 404 diff --git a/tests/test_wave_05.py b/tests/test_wave_05.py index aee7c52a1..35534a6e8 100644 --- a/tests/test_wave_05.py +++ b/tests/test_wave_05.py @@ -1,7 +1,8 @@ +from app.models.goal import Goal import pytest -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_goals_no_saved_goals(client): # Act response = client.get("/goals") @@ -12,7 +13,7 @@ def test_get_goals_no_saved_goals(client): assert response_body == [] -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_goals_one_saved_goal(client, one_goal): # Act response = client.get("/goals") @@ -29,7 +30,7 @@ def test_get_goals_one_saved_goal(client, one_goal): ] -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_goal(client, one_goal): # Act response = client.get("/goals/1") @@ -46,22 +47,17 @@ def test_get_goal(client, one_goal): } -@pytest.mark.skip(reason="test to be completed by student") +# @pytest.mark.skip(reason="test to be completed by student") def test_get_goal_not_found(client): pass # Act response = client.get("/goals/1") response_body = response.get_json() - raise Exception("Complete test") - # Assert - # ---- Complete Test ---- - # assertion 1 goes here - # assertion 2 goes here - # ---- Complete Test ---- - + assert response.status_code == 404 + assert response_body == {'details': 'Invalid Data'} -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_create_goal(client): # Act response = client.post("/goals", json={ @@ -78,36 +74,46 @@ def test_create_goal(client): "title": "My New Goal" } } + new_goal = Goal.query.get(1) + assert new_goal + assert new_goal.title == "My New Goal" -@pytest.mark.skip(reason="test to be completed by student") +# @pytest.mark.skip(reason="test to be completed by student") def test_update_goal(client, one_goal): - raise Exception("Complete test") - # Act - # ---- Complete Act Here ---- + # raise Exception("Complete test") + response = client.put("/goals/1", json={ + "title": "Build a habit of going outside daily" + }) + response_body = response.get_json() # Assert - # ---- Complete Assertions Here ---- - # assertion 1 goes here - # assertion 2 goes here - # assertion 3 goes here - # ---- Complete Assertions Here ---- + assert response.status_code == 200 + assert "goal" in response_body + assert response_body == { + "goal": { + "id": 1, + "title": "Build a habit of going outside daily" + } + } + goal = Goal.query.get(1) + assert goal.title == "Build a habit of going outside daily" -@pytest.mark.skip(reason="test to be completed by student") +# @pytest.mark.skip(reason="test to be completed by student") def test_update_goal_not_found(client): - raise Exception("Complete test") - # Act - # ---- Complete Act Here ---- + response = client.put("/goals/1", json={ + "title": "Build a habit of going outside daily" + + }) + response_body = response.get_json() # Assert - # ---- Complete Assertions Here ---- - # assertion 1 goes here - # assertion 2 goes here - # ---- Complete Assertions Here ---- + assert response.status_code == 404 + assert response_body == {"details": "Invalid Data"} -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_delete_goal(client, one_goal): # Act response = client.delete("/goals/1") @@ -121,30 +127,22 @@ def test_delete_goal(client, one_goal): } # Check that the goal was deleted - response = client.get("/goals/1") - assert response.status_code == 404 + assert Goal.query.get(1) == None - raise Exception("Complete test with assertion about response body") - # ***************************************************************** - # **Complete test with assertion about response body*************** - # ***************************************************************** - -@pytest.mark.skip(reason="test to be completed by student") +# @pytest.mark.skip(reason="test to be completed by student") def test_delete_goal_not_found(client): - raise Exception("Complete test") - - # Act - # ---- Complete Act Here ---- + response = client.delete("/goals/1") + response_body = response.get_json() # Assert - # ---- Complete Assertions Here ---- - # assertion 1 goes here - # assertion 2 goes here - # ---- Complete Assertions Here ---- + assert response.status_code == 404 + assert response_body == {'details': 'Invalid Data'} + assert Goal.query.all() == [] + -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_create_goal_missing_title(client): # Act response = client.post("/goals", json={}) @@ -155,3 +153,4 @@ def test_create_goal_missing_title(client): assert response_body == { "details": "Invalid data" } + assert Goal.query.all() == [] \ No newline at end of file diff --git a/tests/test_wave_06.py b/tests/test_wave_06.py index 8afa4325e..b957d64c7 100644 --- a/tests/test_wave_06.py +++ b/tests/test_wave_06.py @@ -2,7 +2,7 @@ import pytest -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_post_task_ids_to_goal(client, one_goal, three_tasks): # Act response = client.post("/goals/1/tasks", json={ @@ -23,7 +23,7 @@ def test_post_task_ids_to_goal(client, one_goal, three_tasks): assert len(Goal.query.get(1).tasks) == 3 -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_post_task_ids_to_goal_already_with_goals(client, one_task_belongs_to_one_goal, three_tasks): # Act response = client.post("/goals/1/tasks", json={ @@ -42,22 +42,18 @@ def test_post_task_ids_to_goal_already_with_goals(client, one_task_belongs_to_on assert len(Goal.query.get(1).tasks) == 2 -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_tasks_for_specific_goal_no_goal(client): # Act response = client.get("/goals/1/tasks") response_body = response.get_json() - # Assert + # Assert{'details': 'Invalid Data'} assert response.status_code == 404 - - raise Exception("Complete test with assertion about response body") - # ***************************************************************** - # **Complete test with assertion about response body*************** - # ***************************************************************** + assert response_body == { "details": "Invalid Data"} -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_tasks_for_specific_goal_no_tasks(client, one_goal): # Act response = client.get("/goals/1/tasks") @@ -74,7 +70,7 @@ def test_get_tasks_for_specific_goal_no_tasks(client, one_goal): } -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_tasks_for_specific_goal(client, one_task_belongs_to_one_goal): # Act response = client.get("/goals/1/tasks") @@ -99,7 +95,7 @@ def test_get_tasks_for_specific_goal(client, one_task_belongs_to_one_goal): } -@pytest.mark.skip(reason="No way to test this feature yet") +# @pytest.mark.skip(reason="No way to test this feature yet") def test_get_task_includes_goal_id(client, one_task_belongs_to_one_goal): response = client.get("/tasks/1") response_body = response.get_json()