feat: wire feishu notifications into workflows
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user