Beispiel #1
0
    def test_has_view_permissions_grant_user_false(self):
        site = AdminSite()
        classification_inline = SectionInfoInline(ClassificationAdmin, site)
        self.assertIsInstance(classification_inline, ClassificationInline)
        request = MockRequest()

        request.user = User.objects.create(profile=User.GRANT)
        self.assertFalse(classification_inline.has_view_permission(request))
Beispiel #2
0
    def test_has_delete_permission_workflow_engine_user_true(self):
        site = AdminSite()
        classification_inline = SectionInfoInline(ClassificationAdmin, site)
        self.assertIsInstance(classification_inline, ClassificationInline)

        request = MockRequest()

        request.user = User.objects.create(profile=User.WORKFLOW_ENGINE)
        self.assertTrue(classification_inline.has_delete_permission(request))