mirror of
https://github.com/ansible/awx.git
synced 2026-08-03 11:30:00 -02:30
Add Notification Admin
This commit is contained in:
@@ -32,6 +32,11 @@ def test_notification_template_get_queryset_orgadmin(notification_template, user
|
||||
notification_template.organization.admin_role.members.add(user('admin', False))
|
||||
assert access.get_queryset().count() == 1
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_notification_template_get_queryset_notificationadmin(notification_template, user):
|
||||
access = NotificationTemplateAccess(user('admin', False))
|
||||
notification_template.organization.notification_admin_role.members.add(user('admin', False))
|
||||
assert access.get_queryset().count() == 1
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_notification_template_get_queryset_org_auditor(notification_template, org_auditor):
|
||||
@@ -59,12 +64,13 @@ def test_notification_template_access_superuser(notification_template_factory):
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_notification_template_access_admin(organization_factory, notification_template_factory):
|
||||
@pytest.mark.parametrize("role", ["present.admin_role:admin", "present.notification_admin_role:admin"])
|
||||
def test_notification_template_access_admin(role, organization_factory, notification_template_factory):
|
||||
other_objects = organization_factory('other')
|
||||
present_objects = organization_factory('present',
|
||||
users=['admin'],
|
||||
notification_templates=['test-notification'],
|
||||
roles=['present.admin_role:admin'])
|
||||
roles=[role])
|
||||
|
||||
notification_template = present_objects.notification_templates.test_notification
|
||||
other_org = other_objects.organization
|
||||
|
||||
Reference in New Issue
Block a user