migration and testing
This commit is contained in:
12
tests/test_database_smoke.py
Normal file
12
tests/test_database_smoke.py
Normal 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
|
Reference in New Issue
Block a user