# Conflicts:
#	migrations/versions/20260519_0021_portfolio_tags_data_migration.py
#	migrations/versions/20260520_0022_service_token_unique_index_fix.py
This commit is contained in:
2026-05-21 13:28:56 +00:00
5 changed files with 37 additions and 7 deletions
+24
View File
@@ -0,0 +1,24 @@
from fastapi.testclient import TestClient
from app.main import create_app
from app.core.config import Settings
def test_docs_uses_root_path_for_openapi_url() -> None:
app = create_app(settings_factory=lambda: Settings(root_path="/portfolio-hub"))
with TestClient(app) as client:
response = client.get("/docs")
assert response.status_code == 200
assert "url: '/portfolio-hub/openapi.json'" in response.text
def test_openapi_is_served_under_root_path() -> None:
app = create_app(settings_factory=lambda: Settings(root_path="/portfolio-hub"))
with TestClient(app) as client:
response = client.get("/portfolio-hub/openapi.json")
assert response.status_code == 200
assert response.json()["info"]["title"] == "PortfolioHub"