def testTargetFolder(self):
        target_root = self.portal.target
        self.failIf(year in target_root.objectIds())

        e = MoveAction()
        e.target_root_folder = '/target'
        target_adapter = getMultiAdapter((self.folder.source.d1, e),
                                         ITargetFolder)
        target = target_adapter.setup_target()

        self.failUnless("/target/%s/%s" %
                        (year, month) in target.absolute_url())
    def testTargetFolder(self):
        target_root = self.portal.target
        self.failIf(year in target_root.objectIds())

        e = MoveAction()
        e.target_root_folder = '/target'
        target_adapter = getMultiAdapter((self.folder.source.d1, e),
                                         ITargetFolder)
        target = target_adapter.setup_target()

        self.failUnless("/target/%s/%s" % (year, month) in
                        target.absolute_url())
    def testExecute(self):
        e = MoveAction()
        e.target_root_folder = '/target'

        ex = getMultiAdapter(
            (self.folder.source, e, DummyEvent(self.folder.source.d1)),
            IExecutable)
        self.assertEquals(True, ex())

        self.failIf('d1' in self.folder.source.objectIds())
        self.failUnless(year in self.portal.target.objectIds())

        self.failUnless(month in self.portal.target[year].objectIds())
        self.failUnless('d1' in self.portal.target[year][month].objectIds())
    def testExecute(self):
        e = MoveAction()
        e.target_root_folder = '/target'

        ex = getMultiAdapter((self.folder.source,
                              e,
                              DummyEvent(self.folder.source.d1)),
                             IExecutable)
        self.assertEquals(True, ex())

        self.failIf('d1' in self.folder.source.objectIds())
        self.failUnless(year in self.portal.target.objectIds())

        self.failUnless(month in self.portal.target[year].objectIds())
        self.failUnless('d1' in self.portal.target[year][month].objectIds())
 def testInvokeEditView(self):
     element = getUtility(
         IRuleAction, name='collective.contentrules.yearmonth.actions.Move')
     e = MoveAction()
     editview = getMultiAdapter((e, self.folder.source.REQUEST),
                                name=element.editview)
     self.failUnless(isinstance(editview, MoveEditForm))