Esempio n. 1
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)
Esempio n. 2
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)
    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)