feat: public landing page with permission-based tile filtering

This commit is contained in:
Oliver Hofmann
2026-04-27 13:46:53 +02:00
parent 6e7a316091
commit 9e8778f015
2 changed files with 90 additions and 59 deletions
+19 -14
View File
@@ -42,31 +42,36 @@ def auth_cookies(override_db):
return {"access_token": token}
def test_landing_without_auth_redirects(client):
@pytest.fixture
def admin_cookies(override_db):
user = User(username="adminuser", full_name="Admin User", is_admin=True, pw_hash=hash_password("pw"))
override_db.add(user)
override_db.commit()
token = create_access_token(username="adminuser", is_admin=True)
return {"access_token": token}
def test_landing_accessible_without_auth(client):
response = client.get("/")
assert response.status_code == 307
assert "/auth/login" in response.headers["location"]
def test_landing_returns_html(client, auth_cookies):
response = client.get("/", cookies=auth_cookies)
assert response.status_code == 200
assert "text/html" in response.headers["content-type"]
def test_landing_contains_title(client, auth_cookies):
response = client.get("/", cookies=auth_cookies)
assert "University Process Hub" in response.text
def test_landing_shows_no_modules_for_anonymous(client):
response = client.get("/")
assert response.status_code == 200
assert "RSS-Feed Server" not in response.text
def test_landing_contains_rss_module(client, auth_cookies):
def test_landing_shows_modules_for_authenticated(client, auth_cookies):
response = client.get("/", cookies=auth_cookies)
assert response.status_code == 200
assert "RSS-Feed Server" in response.text
def test_landing_navbar_links_present(client, auth_cookies):
response = client.get("/", cookies=auth_cookies)
assert "Übersicht" in response.text
def test_landing_contains_title(client):
response = client.get("/")
assert "University Process Hub" in response.text
def test_landing_info_strip_shows_db_mode(client, auth_cookies):