Skip to content

Commit 32d4a1a

Browse files
fix(workflow): restore xfail on publish_request_approval with accurate reason
GET /workflow (publish approval state) and POST /workflow (set stage) are separate ACL checks. The test account has set-stage permission but not get-approval permission on DEV11, causing 401 regardless of workflow state. The set_workflow_stage setup step is kept — it is still correct hygiene. Unblock: grant Workflow > Publish Approval to Owner role in the test org.
1 parent b2eb8d1 commit 32d4a1a

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tests/integration/api/test_21_workflow.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,19 @@ def test_delete_publish_rule(self, stack, store):
185185
resp = stack.workflows().delete_publish_rule(rule_uid)
186186
h.assert_status(resp, 200)
187187

188+
@pytest.mark.xfail(
189+
reason="GET /workflow returns 401 on DEV11 — 'set stage' (POST) and "
190+
"'get publish approval state' (GET) are separate ACL checks; "
191+
"the test account has the former but not the latter. "
192+
"Unblock by granting Workflow > Publish Approval permission to "
193+
"the Owner role in the test org on DEV11.",
194+
strict=False,
195+
)
188196
def test_publish_request_approval(self, stack, content_type_uid, wf_entry, wf_stage_uid):
189197
if not wf_entry:
190198
pytest.skip("entry not available")
191-
# wf_entry is class-scoped so this class gets a fresh entry that was never
192-
# assigned to a workflow stage. Assign it first so the GET /workflow endpoint
193-
# returns 200 instead of 401 (no active workflow state).
199+
# Put the entry in a workflow stage first — GET /workflow returns 401
200+
# for entries with no active stage on some environments.
194201
if wf_stage_uid:
195202
stage_data = {"workflow": {"workflow_stage": {"comment": "approval test", "uid": wf_stage_uid, "notify": False}}}
196203
stack.workflows().set_workflow_stage(content_type_uid, wf_entry, stage_data)

0 commit comments

Comments
 (0)