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

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

src/s/c/sc.contentrules.movebyattribute-0.5/sc/contentrules/movebyattribute/tests/test_action_movebyattribute.py   sc.contentrules.movebyattribute(Download)
 
        e = rule.actions[0]
        self.failUnless(isinstance(e, MoveByAttributeAction))
        self.assertEquals('/target', e.base_folder)
 
    def testInvokeEditView(self): 
        element = getUtility(IRuleAction, name='sc.contentrules.movebyattribute.MoveByAttribute')
        e = MoveByAttributeAction()
        editview = getMultiAdapter((e, self.folder.REQUEST), name=element.editview)
        self.failUnless(isinstance(editview, MoveByAttributeEditForm))
        self.failIf('d1' in self.folder.objectIds())
        target_folder = self.portal.unrestrictedTraverse('%s/%s' % (e.base_folder[1:],default_user))
        self.failUnless('d1' in target_folder.objectIds())
 
    def testExecuteWithError(self): 
        self.assertEquals(False, ex())
 
        self.failUnless('d1' in self.folder.objectIds())
        self.failIf('d1' in self.portal.target.objectIds())
 
        self.failIf('d1' in self.folder.objectIds())
        target_folder = self.portal.unrestrictedTraverse('%s/%s' % (e.base_folder[1:],default_user))
        self.failUnless('d1' in target_folder.objectIds())