diff --git a/tests/test_documents.py b/tests/test_documents.py index ef0ea94..c3a71ee 100644 --- a/tests/test_documents.py +++ b/tests/test_documents.py @@ -251,6 +251,25 @@ def test_document_list_supports_batch_id_search(client, db): assert "SUB-20260604-001" not in content +def test_document_list_shows_link_to_bound_conversation(client, db): + SubmissionBatch.objects.create( + batch_id="SUB-20260604-201", + product_name="产品C", + workflow_type="registration", + conversation_id="conv-201", + file_count=2, + page_count=12, + import_status="completed", + ) + + response = client.get(reverse("documents:list")) + + content = response.content.decode("utf-8") + assert response.status_code == 200 + assert "查看对话 conv-201" in content + assert reverse("chat:detail", args=["conv-201"]) in content + + def test_build_document_list_context_filters_batches_by_keyword(db): target_batch = SubmissionBatch.objects.create( batch_id="SUB-20260604-101",