コード例 #1
0
    def test_has_add_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_add_permission(request))
コード例 #2
0
    def test_has_add_permission_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_add_permission(request))