Files
natureinpots_community/tests/test_database_smoke.py
2025-05-27 05:19:03 -05:00

13 lines
419 B
Python

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