def METHOD_NAME(response, location, message=None):
    """
    Checks if response is an HTTP redirect to the
    given location.
    :param response: Flask response
    :param location: relative URL path to SERVER_NAME or an absolute URL
    :param message: an optional failure message
    """
    __tracebackhide__ = True
    not_redirect = REDIRECT_MSG.format(response.status_code)
    assert response.status_code in REDIRECT_CODES, message or not_redirect
    assert response.location == location, message