From 7e0c81391b295c6109036e09e4c65cb05e87d16d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 23 Jul 2026 10:27:02 +0530 Subject: [PATCH] test: use a role-less user for the permission check test@example.com carries System Manager in the frappe fixtures, so on a fresh CI site it can read Delivery Note and the lookup legitimately returns the draft. test1@example.com has no roles, making the no-permission assertion environment-independent. --- erpnext/controllers/tests/test_draft_links.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/tests/test_draft_links.py b/erpnext/controllers/tests/test_draft_links.py index 303c96e5a38..a776a21f7f4 100644 --- a/erpnext/controllers/tests/test_draft_links.py +++ b/erpnext/controllers/tests/test_draft_links.py @@ -49,6 +49,7 @@ class TestDraftLinks(ERPNextTestSuite): dn = make_delivery_note(so.name) dn.insert() - with self.set_user("test@example.com"): + # test1@example.com has no roles, so no read permission on Delivery Note + with self.set_user("test1@example.com"): drafts = get_existing_drafts("Sales Order", so.name, "Delivery Note") self.assertEqual(drafts, [])