更新
This commit is contained in:
@@ -710,6 +710,36 @@ def test_ownerless_notes_prescriptions_and_tracking_rows_fail_closed_as_warning(
|
||||
dialog.close()
|
||||
|
||||
|
||||
def test_ownerless_im_messages_fail_closed_before_chat_rendering(
|
||||
application: QApplication,
|
||||
immediate_async: None,
|
||||
) -> None:
|
||||
class OwnerlessMessageRepository(WorkspaceRepository):
|
||||
def list_im_chat_messages(
|
||||
self,
|
||||
diagnosis_id: int,
|
||||
*,
|
||||
only_archived: bool = True,
|
||||
) -> list[dict[str, Any]]:
|
||||
del diagnosis_id, only_archived
|
||||
return [
|
||||
{
|
||||
"msg_id": "ownerless-message",
|
||||
"msg_type": "text",
|
||||
"text": "不应展示的无归属会话",
|
||||
"is_from_doctor": False,
|
||||
}
|
||||
]
|
||||
|
||||
dialog = _open_dialog(application, OwnerlessMessageRepository())
|
||||
chat_text = "\n".join(
|
||||
label.text() for label in dialog.chat_host.findChildren(QLabel)
|
||||
)
|
||||
|
||||
assert "不应展示的无归属会话" not in chat_text
|
||||
dialog.close()
|
||||
|
||||
|
||||
def test_tracking_response_without_diagnosis_owner_is_filtered_without_retry(
|
||||
application: QApplication,
|
||||
immediate_async: None,
|
||||
|
||||
Reference in New Issue
Block a user