This commit is contained in:
Your Name
2026-08-12 14:48:57 +08:00
parent bc9ad1d3cd
commit 6d9fe1bbf8
403 changed files with 1790 additions and 1573 deletions
+12 -1
View File
@@ -423,6 +423,8 @@ def test_order_payload_and_a4_print_document(
assert "黄芪" in rendered
assert "酸枣仁" in rendered
assert "服药前请核对姓名、电话、医生等信息" in rendered
assert '<table align="center" class="paper" width="794" height="1123"' in rendered
assert '<col width="44"/><col/><col width="64"/><col width="24"/>' in rendered
assert "Rp." in rendered
assert "药房联" in rendered
assert "主方" in rendered
@@ -433,8 +435,9 @@ def test_order_payload_and_a4_print_document(
assert "每天2次, 一次2袋, 每袋5g, 温水送服, 饭后" in rendered
viewer = PrescriptionDetailDialog(prescription)
document_html = viewer.document.toHtml()
assert "药房联" in document_html
assert "用药 (单剂)" in document_html
assert viewer.document.idealWidth() == pytest.approx(794.0)
assert viewer.preview.__class__.__name__ == "_PrescriptionPaperPreview"
viewer.close()
order.close()
application.processEvents()
@@ -450,6 +453,7 @@ def test_prescription_detail_can_open_immutable_case_record_tab(
"case_record": {
"patient_name": "林晓岚",
"phone": "13800138000",
"diagnosis_type": "follow_up",
"local_hospital_name": "市中医院",
"symptoms": "口渴乏力",
"tongue_coating": "舌红少苔",
@@ -461,8 +465,15 @@ def test_prescription_detail_can_open_immutable_case_record_tab(
assert viewer.tabs.tabText(viewer.tabs.currentIndex()) == "详细病历"
assert viewer.case_document is not None
case_html = viewer.case_document.toHtml()
source_html = dialog_module.render_case_record_html(prescription)
assert "甄养堂 详细病历" in case_html
assert '<table class="cr-grid"' in source_html
assert "follow_up" not in case_html
assert "复诊" in case_html
assert "市中医院" in case_html
assert "口渴乏力" in case_html
assert viewer.case_preview is not None
assert viewer.case_preview.objectName() == "CaseRecordPaperPreview"
viewer.close()
application.processEvents()
+8 -2
View File
@@ -69,8 +69,9 @@ def test_note_attachment_preview_type_is_extension_aware(path: str, expected: bo
assert _is_image_attachment(path) is expected
def test_note_attachments_offer_image_preview_and_file_open(
def test_note_attachments_expand_images_and_keep_file_open(
application: QApplication,
immediate_async: None,
) -> None:
page = ReceptionPage(DemoDoctorRepository(), PermissionSet([]))
page._render_notes(
@@ -87,8 +88,13 @@ def test_note_attachments_offer_image_preview_and_file_open(
]
)
previews = page.notes_container.findChildren(
QPushButton, "NoteAttachmentPreview"
)
assert len(previews) == 2
assert all(button.text() == "" for button in previews)
assert all(not button.icon().isNull() for button in previews)
labels = [button.text() for button in page.notes_container.findChildren(QPushButton)]
assert labels.count("预览") == 2
assert labels.count("打开") == 1
page.close()
application.processEvents()