[settings] rework settings

This commit is contained in:
2026-07-31 01:50:08 +02:00
parent b7b07b82da
commit bad4e8dd1b
2 changed files with 46 additions and 14 deletions

View File

@@ -5,7 +5,6 @@ from fastapi.testclient import TestClient
from sqlalchemy.pool import StaticPool
from sqlmodel import Session, SQLModel, create_engine
from app.main import app
from app.model.models import (
AccessAuthorizationDB,
Card,
@@ -25,6 +24,16 @@ engine = create_engine(
)
@pytest.fixture
def app():
import os
os.environ["SECRET_KEY"] = "ff" * 16
from app.main import app
return app
@pytest.fixture(scope="function")
def db_session():
"""Create a fresh database session for each test."""
@@ -35,7 +44,7 @@ def db_session():
@pytest.fixture(scope="function")
def client(db_session):
def client(app, db_session):
"""Create a test client with a database session override."""
def override_get_session():