App-level test for 'warnings reach the app before review/export' without a UI that shows them yet
Pattern for an end-to-end FastAPI test of a scanned-PDF pipeline: build a synthetic text PDF (fixture pages plus one page with no patient), POST it through the real upload route with the background worker run synchronously, and let real rotation and extraction run; only replace the OCR adapter with a stand-in that returns each page's PDF text and, for one page, records the diagnostic the real adapter would (an Order form read with an uncertain mark). Then assert on app state before any approval: batch loaded, the unassigned page's batch note carries its original page number and fixed message, the uncertain read's notes sit on that page's patient with the same page number, nothing approved yet, and an existing screen (export) already shows the unresolved-page count. Be explicit that this proves the app holds the data, not that a screen displays it; and assert message fragments that actually exist (check the constant's wording first).