From 81f4d7ec42a4e56ec459c5c2e5fc1687aacf827d Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Thu, 14 Dec 2017 12:41:26 +0530 Subject: [PATCH] users: tests: restore previous value of restricted access Signed-off-by: Joseph Nuthalapati Reviewed-by: James Valleroy --- plinth/modules/users/tests/test_actions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plinth/modules/users/tests/test_actions.py b/plinth/modules/users/tests/test_actions.py index 78184467d..3b15c769a 100644 --- a/plinth/modules/users/tests/test_actions.py +++ b/plinth/modules/users/tests/test_actions.py @@ -84,7 +84,9 @@ class TestActions(unittest.TestCase): '..', 'actions', 'users') self.users = set() self.groups = set() - security.set_restricted_access(False) + self.restricted_access = security.get_restricted_access_enabled() + if self.restricted_access: + security.set_restricted_access(False) def tearDown(self): for user in self.users: @@ -96,7 +98,7 @@ class TestActions(unittest.TestCase): for group in self.groups: self.delete_group(group) - security.set_restricted_access(True) + security.set_restricted_access(self.restricted_access) def call_action(self, arguments, **kwargs): """Call the action script."""