コード例 #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.')