feat: Kategorien-Verwaltung auf der Admin-Seite
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -113,6 +113,23 @@ def test_rules_categorize(client):
|
||||
assert txs[0]["category_id"] == cat["id"]
|
||||
|
||||
|
||||
def test_category_patch(client):
|
||||
a = client.post("/api/categories", headers=H, json={"name": "Kat-A"}).json()
|
||||
b = client.post("/api/categories", headers=H, json={"name": "Kat-B"}).json()
|
||||
# Umbenennen
|
||||
r = client.patch(f"/api/categories/{a['id']}", headers=H, json={"name": "Kat-A-neu"})
|
||||
assert r.status_code == 200 and r.json()["name"] == "Kat-A-neu"
|
||||
# Umbenennen auf den EIGENEN Namen ist erlaubt (kein 409)
|
||||
r = client.patch(f"/api/categories/{a['id']}", headers=H, json={"name": "Kat-A-neu"})
|
||||
assert r.status_code == 200
|
||||
# Kollision mit anderer Kategorie -> 409
|
||||
r = client.patch(f"/api/categories/{a['id']}", headers=H, json={"name": "Kat-B"})
|
||||
assert r.status_code == 409
|
||||
# unbekannte id -> 404
|
||||
assert client.patch("/api/categories/99999", headers=H,
|
||||
json={"name": "x"}).status_code == 404
|
||||
|
||||
|
||||
def test_patch_account_name(client):
|
||||
acc = client.post("/api/accounts", headers=H, json={
|
||||
"bank": "DKB", "iban": "DE71", "name": "DE71", "type": "giro"}).json()
|
||||
|
||||
Reference in New Issue
Block a user