code: def test_custom_metadata_overrides_custom_model_legacy() -> None:
      base = sa_orm.declarative_base(cls=Model, metaclass=DefaultMeta)
      metadata = sa.MetaData()
      db = SQLAlchemy(model_class=base, metadata=metadata)
      assert db.Model.metadata is metadata
      assert db.Model.metadata is db.metadata
  
imports: from __future__ import annotations
  import typing
  import pytest
  import sqlalchemy
  import sqlalchemy.exc
  import sqlalchemy.orm
  from flask import Flask
  from flask_sqlalchemy import SQLAlchemy
  from flask_sqlalchemy.model import DefaultMeta
  from flask_sqlalchemy.model import Model
label_desc: Use image node_id 6 for calling a global function with example usage: test_custom_metadata_overrides_custom_model_legacy() without return types