chore(home): mirror from kalinamall (9883e6a) with papatramp URLs

This commit is contained in:
2026-07-14 20:43:52 +10:00
commit ed4e78f6c3
312 changed files with 42790 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
"""GET/PUT /api/v1/settings/ui"""
from app.models.ui_settings import UI_SETTINGS_ROW_ID, UiSettings
def test_get_ui_settings_default(jwt_headers, client):
response = client.get("/api/v1/settings/ui", headers=jwt_headers)
assert response.status_code == 200
body = response.json()
assert body["show_sidebar_system_stats"] is True
assert body["source"] == "default"
def test_put_ui_settings_persists(jwt_headers, client, db_session):
response = client.put(
"/api/v1/settings/ui",
headers=jwt_headers,
json={"show_sidebar_system_stats": False},
)
assert response.status_code == 200
body = response.json()
assert body["show_sidebar_system_stats"] is False
assert body["source"] == "db"
row = db_session.get(UiSettings, UI_SETTINGS_ROW_ID)
assert row is not None
assert row.show_sidebar_system_stats is False
def test_ui_settings_requires_admin(jwt_monitor_headers, client):
response = client.get("/api/v1/settings/ui", headers=jwt_monitor_headers)
assert response.status_code == 403