code: def test_view_patching(app):
      class Index(flask.views.MethodView):
          def get(self):
              raise ZeroDivisionError
  
          def post(self):
              raise ZeroDivisionError
  
      class Other(Index):
          def get(self):
              return "GET"
  
          def post(self):
              return "POST"
  
      view = Index.as_view("index")
      view.view_class = Other
      app.add_url_rule("/", view_func=view)
      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 4 for calling a global function with example usage: test_view_patching(app) and returns: str, str