Beispiel #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)
Beispiel #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)
Beispiel #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))