code: def test_endpoint_override(app):
      app.debug = True
  
      class Index(flask.views.View):
          methods = ["GET", "POST"]
  
          def dispatch_request(self):
              return flask.request.method
  
      app.add_url_rule("/", view_func=Index.as_view("index"))
  
      with pytest.raises(AssertionError):
          app.add_url_rule("/", view_func=Index.as_view("index"))
  
      # But these tests should still pass. We just log a warning.
      common_test(app)
  
file_path: flask/tests/test_views.py
imports: import pytest
  from werkzeug.http import parse_set_header
  import flask.views
label_desc: Use image node_id 10 for calling a global function with example usage: test_endpoint_override(app) and returns: flask