Add publish endpoint to re-approve rejected workflows

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
bernatsampera
2026-08-09 12:30:31 +02:00
co-authored by Claude Opus 4.6
parent 9a4ada1614
commit 3b3e7da2a3
2 changed files with 36 additions and 1 deletions
+20
View File
@@ -231,6 +231,26 @@ def test_admin_delete_not_found(client, admin):
assert resp.status_code == 404
def test_admin_publish_rejected(client, admin):
submit(client)
client.post("/api/moderation/workflows/demo-flow/reject", headers=admin)
resp = client.post("/api/admin/workflows/demo-flow/publish", headers=admin)
assert resp.status_code == 200
assert resp.json()["status"] == "approved"
public = client.get("/api/workflows/demo-flow")
assert public.status_code == 200
assert public.json()["name"] == "Demo Flow"
def test_admin_publish_not_rejected_404(client, admin):
submit(client)
client.post("/api/moderation/workflows/demo-flow/approve", headers=admin)
resp = client.post("/api/admin/workflows/demo-flow/publish", headers=admin)
assert resp.status_code == 404
def test_admin_delete_requires_token(client):
assert client.delete("/api/admin/workflows/x").status_code == 401