feat: status includes is_admin, gear icon in header for admins
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -146,6 +146,20 @@ def test_audio_combined_forbidden_for_non_admin():
|
||||
app.dependency_overrides.pop(current_user, None)
|
||||
|
||||
|
||||
def test_status_includes_is_admin():
|
||||
from main import app
|
||||
from api.router import current_user
|
||||
app.dependency_overrides[current_user] = lambda: {"username": "u", "output_dir": "/tmp", "is_admin": True}
|
||||
try:
|
||||
from fastapi.testclient import TestClient
|
||||
client = TestClient(app)
|
||||
r = client.get("/status", headers={"Authorization": "Bearer fake"})
|
||||
assert r.status_code == 200
|
||||
assert r.json()["is_admin"] is True
|
||||
finally:
|
||||
app.dependency_overrides.pop(current_user, None)
|
||||
|
||||
|
||||
def test_put_config_deep_merges(tmp_path, monkeypatch):
|
||||
import config as cfg_mod
|
||||
monkeypatch.setattr(cfg_mod, "CONFIG_PATH", str(tmp_path / "config.toml"))
|
||||
|
||||
Reference in New Issue
Block a user