migration and testing

This commit is contained in:
2025-05-27 05:19:03 -05:00
parent d920660366
commit bba83af409
7 changed files with 64 additions and 45 deletions

View File

@ -0,0 +1,12 @@
import pytest
from app import create_app, db
from sqlalchemy import inspect
def test_database_smoke(tmp_path):
db_file = tmp_path / "test.db"
app = create_app({"TESTING": True, "SQLALCHEMY_DATABASE_URI": f"sqlite:///{db_file}"})
with app.app_context():
db.drop_all()
db.create_all()
tables = inspect(db.engine).get_table_names()
assert 'users' in tables or 'user' in tables