users: tests: restore previous value of restricted access

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati 2017-12-14 12:41:26 +05:30 committed by James Valleroy
parent dafd2f113e
commit 81f4d7ec42
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -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."""