def is_object_in_response(obj, response):
    """Check if a given object was returned by the API."""
    response_task_names = [o['name'] for o in response.data['results']]
    return obj.name in response_task_names