Ejemplo n.º 1
0
    def testExecute(self):
        e = SetLayoutAction()
        e.layout = 'folder_summary_view'

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

        self.assertEquals(self.sub_folder.layout, e.layout)
Ejemplo n.º 2
0
    def testExecuteWithError(self):
        e = SetLayoutAction()
        e.layout = 'document_view'

        ex = getMultiAdapter((self.folder, e, DummyEvent(self.sub_folder)),
                             IExecutable)
        self.assertEquals(False, ex())
        # Layout not set
        self.assertEquals(hasattr(self.sub_folder, 'layout'), False)
    def testExecuteWithError(self):
        e = SetLayoutAction()
        e.layout = 'document_view'

        ex = getMultiAdapter((self.folder, e,
                             DummyEvent(self.sub_folder)),
                             IExecutable)
        self.assertEquals(False, ex())
        # Layout not set
        self.assertEquals(hasattr(self.sub_folder, 'layout'), False)
    def testExecute(self):
        e = SetLayoutAction()
        e.layout = 'folder_summary_view'

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

        self.assertEquals(self.sub_folder.layout, e.layout)
Ejemplo n.º 5
0
 def testInvokeEditView(self):
     element = getUtility(IRuleAction,
                          name='sc.contentrules.actions.layout')
     e = SetLayoutAction()
     editview = getMultiAdapter((e, self.folder.REQUEST),
                                name=element.editview)
     self.failUnless(isinstance(editview, SetLayoutEditForm))