fix(testing): ensure idempotency on the test environment user
This commit is contained in:
parent
504ef2e9e4
commit
e2f5536f08
2 changed files with 4 additions and 1 deletions
|
|
@ -85,7 +85,6 @@ class ParallelTestRunner:
|
|||
print("running tests from", "/".join(file_info))
|
||||
return
|
||||
|
||||
frappe.set_user("Administrator")
|
||||
path, filename = file_info
|
||||
module = self.get_module(path, filename)
|
||||
test_suite = unittest.TestSuite()
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@ class UnitTestCase(unittest.TestCase, BaseTestCase):
|
|||
super().setUpClass()
|
||||
cls.doctype = _get_doctype_from_module(cls)
|
||||
cls.module = frappe.get_module(cls.__module__)
|
||||
# Test Environment
|
||||
frappe.set_user("Administrator")
|
||||
# Test Environment (cleanup)
|
||||
cls.addClassCleanup(frappe.set_user, "Administrator")
|
||||
cls._unit_test_case_class_setup_done = True
|
||||
|
||||
def assertQueryEqual(self, first: str, second: str) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue