V6 Post migration cleanup
Quality Gate / gate (push) Failing after 50s

This commit is contained in:
Jim Lancaster
2026-08-26 11:08:10 -05:00
parent c85cc6be20
commit c2ed98c16d
6 changed files with 112 additions and 40 deletions
+35
View File
@@ -17,6 +17,7 @@ from transcription.db.models import Person
from transcription.db.models import PersonRole
from transcription.db.models import Source
from transcription.db.models import Tag
from transcription.ui.pages.documents_page import _first_source_path
from transcription.ui.pages.documents_page import _resolve_selected_tag_labels
# --- Helper Fixtures ---
@@ -107,6 +108,40 @@ class TestDocumentsPageRendering:
re.DOTALL,
)
def test_first_source_path_prefers_lowest_page_number(self):
document = Document(name="Ordering Test")
document.sources = [
Source(
document_id=document.id,
page_number=3,
upload_name="c.jpg",
filename="c.jpg",
file_path="documents/c.jpg",
file_hash="c" * 64,
file_size_bytes=1,
),
Source(
document_id=document.id,
page_number=1,
upload_name="a.jpg",
filename="a.jpg",
file_path="documents/a.jpg",
file_hash="a" * 64,
file_size_bytes=1,
),
Source(
document_id=document.id,
page_number=2,
upload_name="b.jpg",
filename="b.jpg",
file_path="documents/b.jpg",
file_hash="b" * 64,
file_size_bytes=1,
),
]
assert _first_source_path(document) == "documents/a.jpg"
def test_document_create_page_renders_form(self, app_client):
_, client = app_client