code: def test_aborting(app):
      class Foo(Exception):
          whatever = 42
  
      @app.errorhandler(Foo)
      def handle_foo(e):
          return str(e.whatever)
  
      @app.route("/")
      def index():
          raise flask.abort(flask.redirect(flask.url_for("test")))
  
      @app.route("/test")
      def test():
          raise Foo()
  
      with app.test_client() as c:
          rv = c.get("/")
          location_parts = rv.headers["Location"].rpartition("/")
  
          if location_parts[0]:
              # For older Werkzeug that used absolute redirects.
              assert location_parts[0] == "http://localhost"
  
          assert location_parts[2] == "test"
          rv = c.get("/test")
          assert rv.data == b"42"
  
label_desc: Use image node_id 1 for calling a global function with example usage: test_aborting(app) and returns: str