Fix ACL action tests
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -9,16 +9,13 @@ from ..workflow_actions import GrantAccessAction, RevokeAccessAction
|
||||
|
||||
|
||||
class ACLActionTestCase(ActionTestCase):
|
||||
def setUp(self):
|
||||
super(ACLActionTestCase, self).setUp()
|
||||
|
||||
def test_grant_access_action(self):
|
||||
action = GrantAccessAction(
|
||||
form_data={
|
||||
'content_type': ContentType.objects.get_for_model(model=self.document).pk,
|
||||
'object_id': self.document.pk,
|
||||
'roles': [self.role.pk],
|
||||
'permissions': [permission_document_view.uuid],
|
||||
'roles': [self._test_case_role.pk],
|
||||
'permissions': [permission_document_view.pk],
|
||||
}
|
||||
)
|
||||
action.execute(context={'entry_log': self.entry_log})
|
||||
@@ -28,7 +25,7 @@ class ACLActionTestCase(ActionTestCase):
|
||||
list(self.document.acls.first().permissions.all()),
|
||||
[permission_document_view.stored_permission]
|
||||
)
|
||||
self.assertEqual(self.document.acls.first().role, self.role)
|
||||
self.assertEqual(self.document.acls.first().role, self._test_case_role)
|
||||
|
||||
def test_revoke_access_action(self):
|
||||
self.grant_access(
|
||||
@@ -39,8 +36,8 @@ class ACLActionTestCase(ActionTestCase):
|
||||
form_data={
|
||||
'content_type': ContentType.objects.get_for_model(model=self.document).pk,
|
||||
'object_id': self.document.pk,
|
||||
'roles': [self.role.pk],
|
||||
'permissions': [permission_document_view.uuid],
|
||||
'roles': [self._test_case_role.pk],
|
||||
'permissions': [permission_document_view.pk],
|
||||
}
|
||||
)
|
||||
action.execute(context={'entry_log': self.entry_log})
|
||||
|
||||
Reference in New Issue
Block a user