feat: Kategorien-Verwaltung auf der Admin-Seite

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 14:17:48 +02:00
parent b21d7b9839
commit 4431640eb2
6 changed files with 125 additions and 8 deletions

View File

@@ -234,6 +234,21 @@ def test_admin_passwort_success_returns_200_with_confirmation(
assert r2.status_code == 200
# --- Kategorien-Verwaltung --------------------------------------------------
def test_admin_zeigt_kategorien_verwaltung(client_with_env_file, db):
from app.models.tables import Category
client, password = client_with_env_file
client.post("/login", data={"username": "admin", "password": password})
db.add(Category(name="Admin-Kat"))
db.commit()
r = client.get("/admin").text
assert "Kategorien" in r and "Admin-Kat" in r
assert "Neue Kategorie anlegen" in r
assert 'hx-patch="/api/categories/' in r
assert 'hx-post="/api/categories"' in r
# --- Regeln neu anwenden ---------------------------------------------------
def test_apply_rules_retroactively_categorizes_uncategorized_confirmed_tx(db):