code: def test_view_provide_automatic_options_attr():
      app = flask.Flask(__name__)
  
      class Index1(flask.views.View):
          provide_automatic_options = False
  
          def dispatch_request(self):
              return "Hello World!"
  
      app.add_url_rule("/", view_func=Index1.as_view("index"))
      c = app.test_client()
      rv = c.open("/", method="OPTIONS")
      assert rv.status_code == 405
  
      app = flask.Flask(__name__)
  
      class Index2(flask.views.View):
          methods = ["OPTIONS"]
          provide_automatic_options = True
  
          def dispatch_request(self):
              return "Hello World!"
  
      app.add_url_rule("/", view_func=Index2.as_view("index"))
      c = app.test_client()
      rv = c.open("/", method="OPTIONS")
      assert sorted(rv.allow) == ["OPTIONS"]
  
      app = flask.Flask(__name__)
  
      class Index3(flask.views.View):
          def dispatch_request(self):
              return "Hello World!"
  
      app.add_url_rule("/", view_func=Index3.as_view("index"))
      c = app.test_client()
      rv = c.open("/", method="OPTIONS")
      assert "OPTIONS" in rv.allow
  
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 7 for calling a global function with example usage: test_view_provide_automatic_options_attr() and returns: str, str, str