feat: disable_auth also works in testing
This commit is contained in:
parent
05a405cbe6
commit
2d60b4fcc5
1 changed files with 2 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ from fastapi import FastAPI
|
|||
from starlette.middleware.sessions import SessionMiddleware
|
||||
from starlette.middleware.cors import CORSMiddleware
|
||||
|
||||
from src.constants import Environment
|
||||
from src.config import settings
|
||||
from src.api import api_router
|
||||
|
||||
|
|
@ -66,7 +67,7 @@ app.add_middleware(
|
|||
allow_headers=settings.CORS_HEADERS,
|
||||
)
|
||||
|
||||
if settings.ENVIRONMENT == "local" and settings.DISABLE_AUTH:
|
||||
if settings.DISABLE_AUTH and (settings.ENVIRONMENT == Environment.LOCAL or settings.ENVIRONMENT == Environment.TESTING):
|
||||
app.dependency_overrides[get_current_user] = get_dev_user
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue