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

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

src/s/c/sc.contentrules.metadata-1.0.1/src/sc/contentrules/metadata/tests/test_action_rights.py   sc.contentrules.metadata(Download)
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleAction
from sc.contentrules.metadata.actions.rights import RightsAction
from sc.contentrules.metadata.actions.rights import RightsEditForm
from sc.contentrules.metadata.testing import INTEGRATION_TESTING
    def test_invoke_edit_view(self):
        element = getUtility(IRuleAction,
                             name='sc.contentrules.actions.Rights')
        e = RightsAction()
        editview = getMultiAdapter((e, self.folder.REQUEST),
                                   name=element.editview)
        self.failUnless(isinstance(editview, RightsEditForm))
 
    def test_execute(self):
        e = RightsAction()
    def test_execute_only_if_empty(self):
        e = RightsAction()
        e.rights = 'Creative Commons 2.0'
        e.only_empty = True
 
    def test_execute_empty(self):
        e = RightsAction()
        e.rights = 'Creative Commons 2.0'
        e.only_empty = False