更新
This commit is contained in:
@@ -7,7 +7,7 @@ os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
|
||||
|
||||
import pytest
|
||||
from PySide6.QtCore import QPoint, Qt
|
||||
from PySide6.QtWidgets import QApplication, QTabWidget, QWidget
|
||||
from PySide6.QtWidgets import QApplication, QDialog, QTabWidget, QWidget
|
||||
|
||||
from doctor_workstation.ui.dialogs.prescription import PrescriptionEditorDialog
|
||||
|
||||
@@ -31,9 +31,10 @@ def _seed() -> dict[str, object]:
|
||||
"gender": 0,
|
||||
"age": 34,
|
||||
"visit_no": "1K00000401",
|
||||
"tongue": "舌淡红、苔薄白",
|
||||
"pulse": "面色少华",
|
||||
"pulse_condition": "脉细",
|
||||
"tongue": "面色少华",
|
||||
"tongue_image": "舌淡红、苔薄白",
|
||||
"pulse": "脉细",
|
||||
"pulse_condition": "沉取无力",
|
||||
"clinical_diagnosis": "气阴两虚",
|
||||
"doctor_name": "陈医生",
|
||||
"herbs": [
|
||||
@@ -116,7 +117,7 @@ def test_drawer_uses_full_width_on_a_narrow_host(application: QApplication) -> N
|
||||
application.processEvents()
|
||||
|
||||
|
||||
def test_duplicate_guard_and_admin_dto_survive_the_visual_restructure(
|
||||
def test_duplicate_warning_and_admin_dto_survive_the_visual_restructure(
|
||||
application: QApplication,
|
||||
) -> None:
|
||||
source = _seed()
|
||||
@@ -138,11 +139,10 @@ def test_duplicate_guard_and_admin_dto_survive_the_visual_restructure(
|
||||
assert payload["herbs"][0]["formula_type"] == "主方"
|
||||
assert payload["herbs"][1]["formula_type"] == "辅方"
|
||||
assert all(bool(row.property("duplicate")) for row in editor.herbs.rows)
|
||||
assert "存在重复药名" in editor.herb_summary.text()
|
||||
|
||||
editor.accept()
|
||||
assert editor.result() == 0
|
||||
assert editor.tabs.currentIndex() == 1
|
||||
assert "药材不可重复:黄芪" in editor.validation.label.text()
|
||||
assert editor.result() == QDialog.DialogCode.Accepted
|
||||
|
||||
editor.close()
|
||||
application.processEvents()
|
||||
|
||||
Reference in New Issue
Block a user