@@ -147,62 +147,3 @@ def test_mark_incomplete_missing_task(client):
147147 # *****************************************************************
148148 # **Complete test with assertion about response body***************
149149 # *****************************************************************
150-
151-
152- # Let's add this test for creating tasks, now that
153- # the completion functionality has been implemented
154- @pytest .mark .skip (reason = "No way to test this feature yet" )
155- def test_create_task_with_valid_completed_at (client ):
156- # Act
157- response = client .post ("/tasks" , json = {
158- "title" : "A Brand New Task" ,
159- "description" : "Test Description" ,
160- "completed_at" : datetime .utcnow ()
161- })
162- response_body = response .get_json ()
163-
164- # Assert
165- assert response .status_code == 201
166- assert "task" in response_body
167- assert response_body == {
168- "task" : {
169- "id" : 1 ,
170- "title" : "A Brand New Task" ,
171- "description" : "Test Description" ,
172- "is_complete" : True
173- }
174- }
175- new_task = Task .query .get (1 )
176- assert new_task
177- assert new_task .title == "A Brand New Task"
178- assert new_task .description == "Test Description"
179- assert new_task .completed_at
180-
181-
182- # Let's add this test for updating tasks, now that
183- # the completion functionality has been implemented
184- @pytest .mark .skip (reason = "No way to test this feature yet" )
185- def test_update_task_with_completed_at_date (client , completed_task ):
186- # Act
187- response = client .put ("/tasks/1" , json = {
188- "title" : "Updated Task Title" ,
189- "description" : "Updated Test Description" ,
190- "completed_at" : datetime .utcnow ()
191- })
192- response_body = response .get_json ()
193-
194- # Assert
195- assert response .status_code == 200
196- assert "task" in response_body
197- assert response_body == {
198- "task" : {
199- "id" : 1 ,
200- "title" : "Updated Task Title" ,
201- "description" : "Updated Test Description" ,
202- "is_complete" : True
203- }
204- }
205- task = Task .query .get (1 )
206- assert task .title == "Updated Task Title"
207- assert task .description == "Updated Test Description"
208- assert task .completed_at
0 commit comments