Initial commit with webpage
This commit is contained in:
commit
26875de1dd
55 files changed
+5726
No files matched your search
@@ -0,0 +1,14 @@
|
||||
"""Catches "edited models.py but forgot the migration"."""
|
||||
|
||||
from alembic.autogenerate import compare_metadata
|
||||
from alembic.migration import MigrationContext
|
||||
|
||||
from app.db import engine
|
||||
from app.models import Base, alembic_compare_type
|
||||
|
||||
|
||||
def test_migrations_match_models(_app_started):
|
||||
with engine.connect() as conn:
|
||||
ctx = MigrationContext.configure(conn, opts={"compare_type": alembic_compare_type})
|
||||
diff = compare_metadata(ctx, Base.metadata)
|
||||
assert diff == [], f"Models and migrations differ; run: alembic revision --autogenerate\n{diff}"
|
||||
Reference in new issue
Block a user