feat: use Mapped syntax for columns
This commit is contained in:
parent
cb70f17ad5
commit
6397bd1316
9 changed files with 108 additions and 105 deletions
|
|
@ -14,16 +14,16 @@ from src.iam.models import Group, Permission, OrgPermissions
|
|||
from src.auth.service import get_current_user, get_dev_user
|
||||
from src.auth.dependencies import empty_su_list, get_super_admin_list, testing_su_list
|
||||
from src.main import app # inited FastAPI app
|
||||
from src.database import engine, Base, get_db
|
||||
|
||||
from src.database import engine, get_db
|
||||
from models import CustomBase
|
||||
|
||||
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def db_session():
|
||||
Base.metadata.drop_all(bind=engine)
|
||||
Base.metadata.create_all(bind=engine)
|
||||
CustomBase.metadata.drop_all(bind=engine)
|
||||
CustomBase.metadata.create_all(bind=engine)
|
||||
db = SessionLocal()
|
||||
try:
|
||||
_seed(db) # extracted seeding logic into a plain function
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue