Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

src/s/c/sc.contentrules.layout-1.0.1/src/sc/contentrules/layout/tests/test_action.py   sc.contentrules.layout(Download)
from plone.contentrules.rule.interfaces import IExecutable
 
from sc.contentrules.layout.config import VOCAB
 
from sc.contentrules.layout.actions.layout import SetLayoutAction
    def testRuleWithoutCondition(self):
        rule = self.rule
        self._add_action(rule)
        util = getUtility(IVocabularyFactory, VOCAB)
        vocab = util(rule)
    def testRuleWithCondition(self):
        rule = self.rule
        self._add_condition(rule)
        self._add_action(rule)
        util = getUtility(IVocabularyFactory, VOCAB)
    def testRuleWithPTCollection(self):
        rule = self.rule
        self._add_condition(rule, types=['Collection', ])
        self._add_action(rule)
        util = getUtility(IVocabularyFactory, VOCAB)
        self._add_condition(rule, ['Folder', 'Document'])
        self._add_action(rule)
        util = getUtility(IVocabularyFactory, VOCAB)
        vocab = util(rule)
        self.assertEquals(len(vocab.by_token), 1)