restrict editing of orphan notification templates to superusers

This commit is contained in:
AlanCoding
2016-06-23 08:47:02 -04:00
parent a22cbebcb9
commit 2bebb76881
2 changed files with 10 additions and 3 deletions

View File

@@ -75,3 +75,9 @@ def test_notification_template_access_org_user(notification_template, user):
assert not access.can_read(notification_template)
assert not access.can_change(notification_template, None)
assert not access.can_delete(notification_template)
@pytest.mark.django_db
def test_notificaiton_template_orphan_access_org_admin(notification_template, organization, org_admin):
notification_template.organization = None
access = NotificationTemplateAccess(org_admin)
assert not access.can_change(notification_template, {'organization': organization.id})