code: def test_config_field(app, client):
      app.config["API_TITLE"] = "Pet API"
  
      class GoodSchema(Schema):
          title = Config("API_TITLE")
  
      class BadSchema(Schema):
          description = Config("API_DESCRIPTION")
  
      @app.get("/good")
      @app.output(GoodSchema)
      def good():
          return {}
  
      rv = client.get("/openapi.json")
      assert rv.status_code == 200
  
      rv = client.get("/good")
      assert rv.status_code == 200
      assert rv.json == {"title": "Pet API"}
  
      with pytest.raises(
          ValueError, match=r"The key.*is not found in the app config."
      ):
          with app.app_context():
              bad = BadSchema()
              bad.dump({})
  
file_path: apiflask/tests/test_fields.py
imports: import io
  import pytest
  from werkzeug.datastructures import FileStorage
  from .schemas import Files
  from .schemas import FilesList
  from apiflask import Schema
  from apiflask.fields import Config
label_desc: Use image node_id 3 for calling a global function with example usage: test_config_field(app, client) and returns: dict