Add Notification Admin

This commit is contained in:
Wayne Witzel III
2018-02-02 16:51:10 +00:00
parent fbece6bdde
commit 9e7bd55579
5 changed files with 55 additions and 35 deletions

View File

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