Exemple #1
0
    def XtestNoContentRulesRegistered(self):
        # Testing for event subscribers would be the cleanest approach, but is
        # hard to do. Instead we test for extra marker interfaces set by the
        # plone.app.contentrules zcml.
        from plone.contentrules.engine.interfaces import IRuleAssignable

        self.failUnless(not IRuleAssignable.providedBy(self.portal))
Exemple #2
0
    def show_rules_tab(self):
        """Whether or not the rules tab should be shown
        """

        if not IRuleAssignable.providedBy(self.context):
            return False

        if not getSecurityManager().checkPermission('Content rules: Manage rules', self.context):
            return False

        storage = queryUtility(IRuleStorage)
        if not storage:
            return False

        return storage.active
Exemple #3
0
    def check_iftttconfig(self):

        # check that we are on a folder where content rules can be assigned
        if not IRuleAssignable.providedBy(self.context):
            return False

        # checks that content rules are not globally disabled
        # from content rules control panel
        storage = queryUtility(IRuleStorage)
        if not storage.active:
            return False

        # check if IFTTT secret key is added
        secret_key = api.portal.get_registry_record('ifttt.ifttt_secret_key')
        if not secret_key:
            return False
        return True
 def testRuleContainerInterfaces(self):
     self.assertTrue(IRuleAssignable.providedBy(self.folder))
     self.assertTrue(IRuleAssignable.providedBy(self.portal))
Exemple #5
0
 def XtestNoContentRulesRegistered(self):
     # Testing for event subscribers would be the cleanest approach, but is
     # hard to do. Instead we test for extra marker interfaces set by the
     # plone.app.contentrules zcml.
     from plone.contentrules.engine.interfaces import IRuleAssignable
     self.failUnless(not IRuleAssignable.providedBy(self.portal))
 def testRuleContainerInterfaces(self):
     self.failUnless(IRuleAssignable.providedBy(self.folder))
     self.failUnless(IRuleAssignable.providedBy(self.portal))
Exemple #7
0
 def testRuleContainerInterfaces(self):
     self.assertTrue(IRuleAssignable.providedBy(self.folder))
     self.assertTrue(IRuleAssignable.providedBy(self.portal))
Exemple #8
0
 def testRuleContainerInterfaces(self):
     self.failUnless(IRuleAssignable.providedBy(self.folder))
     self.failUnless(IRuleAssignable.providedBy(self.portal))