dify/api/tests
GareArc f533e992d4
fix(hitl): scope OpenAPI/Service-API resume to author-configured webapp forms
Pause-time token emission now draws only from the recipient set each API
surface is allowed to act on (emit ⊆ validate), so the CLI/OpenAPI caller is
never handed a token the resume endpoint would reject as 404 (WTA-867).

A form's recipients are partitioned once, per surface, into a single
FormDisposition: the surface-actionable recipient yields `form_token`, while
the rest are reported as `approval_channels` (e.g. ["email", "console"]) so the
caller is told where approval actually happens. Token and channels are two
projections of one decision (disposition_for_surface) loaded by one recipient
query (load_form_dispositions_by_form_id); the live pause path and the
reconnect snapshot path consume the same FormDisposition so they cannot drift.

RecipientType carries its user-facing approval-channel label as an enum tuple
value, set in __new__, so a new recipient type cannot be declared without one.

Tests: consolidate recipient/disposition/enrich tests into parametrized
matrices, add CONSOLE-surface and empty-token coverage, extract a shared fake
session for the pause-event tests.
2026-06-16 16:11:29 -07:00
..
fixtures/workflow chore(api): Upgrade graphon to v0.5.1 (#37168) 2026-06-11 07:37:27 +00:00
helpers feat(api): introduce model-type migration script (#36520) 2026-05-27 02:12:11 +00:00
integration_tests feat(web): refine onboarding UI (#37433) 2026-06-15 08:47:15 +00:00
test_containers_integration_tests chore: example use caplog in test (#37470) 2026-06-16 01:10:09 +00:00
unit_tests fix(hitl): scope OpenAPI/Service-API resume to author-configured webapp forms 2026-06-16 16:11:29 -07:00
__init__.py refactor: move vdb implementations to workspaces (#34900) 2026-04-13 08:56:43 +00:00
conftest.py refactor(workflow-file): move core.file to core.workflow.file (#32252) 2026-02-16 22:38:19 +08:00
pytest_dify.py test(api): manage backend pytest services natively (#36235) 2026-05-19 07:52:15 +00:00
seed_legacy_model_type_dirty_data.py feat(api): introduce model-type migration script (#36520) 2026-05-27 02:12:11 +00:00
workflow_test_utils.py chore: reorg imports (#35308) 2026-04-16 08:50:02 +00:00