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())
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.')
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))