mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 19:51:08 -03:30
notifier rbac test made consistent with others
This commit is contained in:
@@ -202,7 +202,7 @@ def notification(notification_template):
|
|||||||
status='successful',
|
status='successful',
|
||||||
notifications_sent=1,
|
notifications_sent=1,
|
||||||
notification_type='email',
|
notification_type='email',
|
||||||
recipients='admin@admin.com',
|
recipients='admin@redhat.com',
|
||||||
subject='email subject')
|
subject='email subject')
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
@@ -91,13 +91,29 @@ def test_notificaiton_template_orphan_access_org_admin(notification_template, or
|
|||||||
assert not access.can_change(notification_template, {'organization': organization.id})
|
assert not access.can_change(notification_template, {'organization': organization.id})
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_notification_access_org_admin(notification, org_admin):
|
def test_notification_access_get_queryset_org_admin(notification, org_admin):
|
||||||
access = NotificationAccess(org_admin)
|
access = NotificationAccess(org_admin)
|
||||||
assert access.get_queryset().count() == 1
|
assert access.get_queryset().count() == 1
|
||||||
|
|
||||||
|
@pytest.mark.django_db
|
||||||
|
def test_notification_access_get_queryset_org_auditor(notification, org_auditor):
|
||||||
|
access = NotificationAccess(org_auditor)
|
||||||
|
assert access.get_queryset().count() == 1
|
||||||
|
|
||||||
|
@pytest.mark.django_db
|
||||||
|
def test_notification_access_system_admin(notification, admin):
|
||||||
|
access = NotificationAccess(admin)
|
||||||
assert access.can_read(notification)
|
assert access.can_read(notification)
|
||||||
|
assert access.can_delete(notification)
|
||||||
|
|
||||||
|
@pytest.mark.django_db
|
||||||
|
def test_notification_access_org_admin(notification, org_admin):
|
||||||
|
access = NotificationAccess(org_admin)
|
||||||
|
assert access.can_read(notification)
|
||||||
|
assert access.can_delete(notification)
|
||||||
|
|
||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
def test_notification_access_org_auditor(notification, org_auditor):
|
def test_notification_access_org_auditor(notification, org_auditor):
|
||||||
access = NotificationAccess(org_auditor)
|
access = NotificationAccess(org_auditor)
|
||||||
assert access.get_queryset().count() == 1
|
|
||||||
assert access.can_read(notification)
|
assert access.can_read(notification)
|
||||||
|
assert not access.can_delete(notification)
|
||||||
|
|||||||
Reference in New Issue
Block a user