예제 #1
0
    def testExecute(self):
        e = Action()
        e.app = 'testapp'
        e.block = 'rule'
        e.method = 'hello'

        ex = getMultiAdapter(
            (self.portal, e, DummyEvent(self.portal)), IExecutable)
        self.assertEqual(True, ex())
예제 #2
0
    def testNotFound(self):
        e = Action()
        e.app = 'badapp'
        e.block = 'rule'
        e.method = 'hello'

        ex = getMultiAdapter(
            (self.portal, e, DummyEvent(self.portal)), IExecutable)
        ex()
        new_cookies = self.request.RESPONSE.cookies[STATUSMESSAGEKEY]
        messages = _decodeCookieValue(new_cookies['value'])
        self.assertEquals(messages[0].message,
            u'Rapido application badapp cannot be found.')
예제 #3
0
 def testInvokeEditView(self):
     element = getUtility(IRuleAction, name='rapido.plone.Action')
     e = Action()
     editview = getMultiAdapter((e, self.request), name=element.editview)
     self.assertTrue(isinstance(editview, EditFormView))