feat: wire feishu notifications into workflows

This commit is contained in:
2026-06-07 22:09:47 +08:00
parent 820069f558
commit cbc7493df8
8 changed files with 301 additions and 1 deletions

View File

@@ -71,6 +71,31 @@ def test_start_file_summary_workflow_runs_synchronously_for_tests(django_user_mo
assert WorkflowEvent.objects.filter(batch=batch, event_type="workflow_completed").exists()
def test_file_summary_workflow_dispatches_completion_notification(monkeypatch, django_user_model):
user = django_user_model.objects.create_user(username="owner", password="pass")
conversation = Conversation.objects.create(user=user, title="会话")
FileAttachment.objects.create(
conversation=conversation,
user=user,
original_name="a.docx",
storage_path="x/a.docx",
file_size=1,
)
batch = create_file_summary_batch(conversation=conversation, user=user)
calls = []
def fake_dispatch(context):
calls.append(context)
monkeypatch.setattr("review_agent.file_summary.workflow.dispatch_workflow_notification", fake_dispatch)
start_file_summary_workflow(batch, async_run=False)
assert calls
assert calls[-1].workflow_type == "file_summary"
assert calls[-1].workflow_batch_id == batch.pk
def test_workflow_extracts_archive_and_scans_extracted_files(settings, tmp_path, django_user_model):
settings.MEDIA_ROOT = tmp_path
user = django_user_model.objects.create_user(username="owner", password="pass")