def METHOD_NAME(self, client, access_token, tasks):
    for task in filter(lambda x: x["status"] in TaskStatus.incomplete(), tasks):
        url = "/tasks/{}/cancel".format(task["_id"])
        headers = {
            "Authorization": access_token,
            "Content-Type": "application/json",
        }
        response = client.post(url, headers=headers)
        assert response.status_code == 204