AP1.5: Project, Task und Ausführung als Ist-Kern
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 1m39s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 1m39s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
Schema 013; Projekte/Arbeitspakete/Aufgaben pflegbar; Tab Zielzustände vs Ausführung. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2e7651812a
commit
6eeddfdc76
27 files changed
+1459
-50
No files matched your search
@@ -0,0 +1,75 @@
|
||||
"""AP1.5 — Project, Task, Action.project_id."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from tests.factories import provision_user_in_tenant
|
||||
from tests.test_initiatives_actions import (
|
||||
_auth,
|
||||
_create_initiative,
|
||||
_login,
|
||||
)
|
||||
|
||||
|
||||
def test_project_and_action_hierarchy(client):
|
||||
user = provision_user_in_tenant(tenant_role="member")
|
||||
token = _login(client, user)
|
||||
initiative_id = _create_initiative(client, token).json()["id"]
|
||||
|
||||
project = client.post(
|
||||
f"/api/initiatives/{initiative_id}/projects",
|
||||
json={"title": "Karate Grundlagen", "description": "8 Fähigkeiten"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert project.status_code == 201
|
||||
project_id = project.json()["id"]
|
||||
|
||||
action = client.post(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
json={"title": "Kata Heian Shodan", "project_id": project_id},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert action.status_code == 201
|
||||
assert action.json()["project_id"] == project_id
|
||||
|
||||
task = client.post(
|
||||
f"/api/actions/{action.json()['id']}/tasks",
|
||||
json={"title": "Standfußarbeit üben"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert task.status_code == 201
|
||||
assert task.json()["status"] == "open"
|
||||
|
||||
listed = client.get(
|
||||
f"/api/actions/{action.json()['id']}/tasks",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert listed.status_code == 200
|
||||
assert len(listed.json()) == 1
|
||||
|
||||
projects = client.get(
|
||||
f"/api/initiatives/{initiative_id}/projects",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert projects.status_code == 200
|
||||
assert len(projects.json()) == 1
|
||||
|
||||
|
||||
def test_initiative_without_projects_still_works(client):
|
||||
user = provision_user_in_tenant(tenant_role="member")
|
||||
token = _login(client, user)
|
||||
initiative_id = _create_initiative(client, token).json()["id"]
|
||||
|
||||
action = client.post(
|
||||
f"/api/initiatives/{initiative_id}/actions",
|
||||
json={"title": "Freistehende Aufgabe"},
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert action.status_code == 201
|
||||
assert action.json().get("project_id") is None
|
||||
|
||||
projects = client.get(
|
||||
f"/api/initiatives/{initiative_id}/projects",
|
||||
headers=_auth(token),
|
||||
)
|
||||
assert projects.status_code == 200
|
||||
assert projects.json() == []
|
||||
@@ -45,6 +45,8 @@ def test_registry_contains_initial_capabilities():
|
||||
"kairo.recurring.manage",
|
||||
"kairo.roadmap.reopen",
|
||||
"kairo.roadmap.reopen.emergency",
|
||||
"kairo.project.read",
|
||||
"kairo.project.manage",
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +58,7 @@ def test_sync_is_idempotent():
|
||||
try:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("SELECT COUNT(*) FROM capabilities")
|
||||
assert cur.fetchone()[0] == 35
|
||||
assert cur.fetchone()[0] == 37
|
||||
cur.execute("SELECT COUNT(*) FROM role_capability_grants")
|
||||
assert cur.fetchone()[0] >= 5
|
||||
finally:
|
||||
|
||||
Reference in new issue
Block a user