def METHOD_NAME(app: Sanic, expected, priorities):
    order = []
    def add_ident(request, response, ident):
        order.append(ident)
    @app.get("/")
    def handler(request):
        return json(None)
    for ident, priority in enumerate(priorities):
        kwargs = {}
        if priority is not None:
            kwargs["priority"] = priority
        app.on_response(partial(add_ident, ident=ident), **kwargs)
    app.test_client.get("/")
    assert order[::-1] == expected