test: fix test for nested permission

This commit is contained in:
Sagar Vora 2025-06-27 14:44:09 +05:30
parent e01b6ff4ec
commit 35581eb50b

View file

@ -566,8 +566,8 @@ class TestDBQuery(IntegrationTestCase):
# to avoid if_owner filter
update("Nested DocType", "All", 0, "if_owner", 0)
frappe.set_user("test2@example.com")
data = DatabaseQuery("Nested DocType").execute()
with self.set_user("test2@example.com"):
data = DatabaseQuery("Nested DocType").execute()
# children of root folder (for which we added user permission) should be accessible
self.assertTrue({"name": "Level 2 A"} in data)
@ -577,7 +577,6 @@ class TestDBQuery(IntegrationTestCase):
self.assertFalse({"name": "Level 1 B"} in data)
self.assertFalse({"name": "Level 2 B"} in data)
update("Nested DocType", "All", 0, "if_owner", 1)
frappe.set_user("Administrator")
def test_filter_sanitizer(self):
self.assertRaises(