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.
This commit is contained in:
Nabin Hait
2026-07-23 10:27:02 +05:30
parent 01f7e45058
commit 7e0c81391b

View File

@@ -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, [])