Created unit tests for priorities.py router
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m6s
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m6s
This commit is contained in:
@@ -6,6 +6,7 @@ from sqlalchemy.orm import Session
|
||||
from app.auth.dependencies import get_current_user
|
||||
from app.models.auth import CognitoUser
|
||||
from app.routers.channels import router as channels_router
|
||||
from app.routers.priorities import router as priorities_router
|
||||
from app.utils.database import get_db
|
||||
from tests.utils.db_mocks import (
|
||||
MockBase,
|
||||
@@ -56,6 +57,7 @@ def admin_user_client(db_session: Session):
|
||||
"""Yields a TestClient configured with an admin user."""
|
||||
test_app = FastAPI()
|
||||
test_app.include_router(channels_router)
|
||||
test_app.include_router(priorities_router)
|
||||
test_app.dependency_overrides[get_db] = mock_get_db
|
||||
test_app.dependency_overrides[get_current_user] = mock_get_current_user_admin
|
||||
with TestClient(test_app) as test_client:
|
||||
@@ -67,6 +69,7 @@ def non_admin_user_client(db_session: Session):
|
||||
"""Yields a TestClient configured with a non-admin user."""
|
||||
test_app = FastAPI()
|
||||
test_app.include_router(channels_router)
|
||||
test_app.include_router(priorities_router)
|
||||
test_app.dependency_overrides[get_db] = mock_get_db
|
||||
test_app.dependency_overrides[get_current_user] = mock_get_current_user_non_admin
|
||||
with TestClient(test_app) as test_client:
|
||||
|
||||
Reference in New Issue
Block a user