"""Test for the create_db_and_tables function in backend.models.""" from unittest.mock import patch from backend.models import Base from backend.models import create_db_and_tables from backend.models import engine def test_create_db_and_tables() -> None: """Test the create_db_and_tables function. Verifies that the function correctly calls SQLModel.metadata.create_all with the synchronous engine. """ with patch.object(Base.metadata, "create_all") as mock_create_all: create_db_and_tables() mock_create_all.assert_called_once_with(engine.sync_engine)