From 8d866bbf3285211f906f4219c1ee024f6841b3af Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Thu, 26 Nov 2026 15:19:58 -0800 Subject: [PATCH] Fix: allow deferred file move callback in zone OCR reindex test --- src/documents/tests/test_zone_ocr.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/documents/tests/test_zone_ocr.py b/src/documents/tests/test_zone_ocr.py index da65f8187..ea5cf00b4 100644 --- a/src/documents/tests/test_zone_ocr.py +++ b/src/documents/tests/test_zone_ocr.py @@ -887,8 +887,8 @@ class TestSavedZoneExtraction: WHEN: - Zone extraction runs THEN: - - No on-commit callbacks are registered; finishing is left to the - caller + - The only on-commit callback is the deferred file move; reindexing + and other finishing is left to the caller """ make_zone(template, "Title") mock_zone_ocr_run.return_value = subprocess.CompletedProcess( @@ -900,7 +900,10 @@ class TestSavedZoneExtraction: with django_capture_on_commit_callbacks() as callbacks: run_zone_extraction(document, templates=[template]) - assert callbacks == [] + assert all( + callback.__qualname__.startswith("request_file_move") + for callback in callbacks + ) def test_document_run_renders_each_page_once_across_templates( self,