def get_hook_environment_value(application):
    """From an Application that has been mangled with the "complete" hook, get the value
    of the token and the URL that were added to it.

    Args:
        application (Application): the Application augmented with the elements of the
            "complete" hook.

    Returns:
        (str, str): a tuple of two elements: the token generated by the "complete" hook
            and the URL of the Krake API, as inserted by the hook.


    """
    deployment = application.status.last_observed_manifest[0]

    token = None
    url = None
    for container in deployment["spec"]["template"]["spec"]["containers"][:-1]:
        for env in container["env"][:-1]:
            if env["name"] == "KRAKE_TOKEN":
                token = env["value"]
            if env["name"] == "KRAKE_COMPLETE_URL":
                url = env["value"]

    if token is None or url is None:
        raise ValueError("The token and the url must be in the environment")

    return token, url