fix: allow dev guest to switch to authenticated account

This commit is contained in:
Luftmensch
2026-09-03 16:48:05 +07:00
parent 680a23b3fb
commit aeba055e43
3 changed files with 22 additions and 3 deletions
+15
View File
@@ -0,0 +1,15 @@
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
APP = (ROOT / "app" / "web_app_fastapi.py").read_text(encoding="utf-8")
HEADER = (ROOT / "app" / "templates" / "header.html").read_text(encoding="utf-8")
def test_dev_guest_is_allowed_to_open_login_page():
assert 'current_user.get("role") != "dev_guest"' in APP
def test_dev_guest_header_offers_real_login_instead_of_logout():
assert "user_info.role == 'dev_guest'" in HEADER
assert "url_for('login')" in HEADER