TorbatYar/backend/services/delivery/app/tests/test_migration.py
Mortezakoohjani 5c6a2e78cf feat(platform): seed service registry, deploy all modules, and fix homepage catalog.
Register all active platform services and base features in core DB so admin can manage them, add delivery/hospitality/sports-center backend phases, update apps catalog and production deploy tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 12:39:51 +03:30

37 lines
1.0 KiB
Python

"""Migration validation."""
from pathlib import Path
from app.core.database import Base
import app.models # noqa: F401
EXPECTED_TABLES = {
"delivery_organizations",
"delivery_hubs",
"delivery_roles",
"delivery_permissions",
"external_provider_configs",
"routing_engine_registrations",
"delivery_configurations",
"delivery_settings",
"delivery_audit_logs",
"drivers",
"driver_credentials",
"driver_documents",
"driver_lifecycle_events",
"outbox_events",
}
def test_alembic_revision_exists():
versions = Path(__file__).resolve().parents[2] / "alembic" / "versions"
files = list(versions.glob("0001_initial*.py"))
assert files, "missing 0001_initial migration"
phase101 = list(versions.glob("0002_phase_101_drivers*.py"))
assert phase101, "missing 0002_phase_101_drivers migration"
def test_metadata_has_foundation_tables():
names = set(Base.metadata.tables.keys())
assert EXPECTED_TABLES.issubset(names)