Back to index

plone3  3.1.7
Public Member Functions
plone.app.contentrules.tests.test_action_logger.TestLoggerAction Class Reference
Inheritance diagram for plone.app.contentrules.tests.test_action_logger.TestLoggerAction:
Inheritance graph
[legend]
Collaboration diagram for plone.app.contentrules.tests.test_action_logger.TestLoggerAction:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testRegistered
def testInvokeAddView
def testInvokeEditView
def testExecute

Detailed Description

Definition at line 18 of file test_action_logger.py.


Member Function Documentation

Definition at line 20 of file test_action_logger.py.

00020 
00021     def afterSetUp(self):
00022         self.setRoles(('Manager',))

Here is the call graph for this function:

Definition at line 53 of file test_action_logger.py.

00053 
00054     def testExecute(self): 
00055         e = LoggerAction()
00056         e.targetLogger = 'testing'
00057         e.loggingLevel = 0
00058         e.message = 'Test log event'
00059         
00060         ex = getMultiAdapter((self.folder, e, DummyEvent()), IExecutable)
00061         self.assertEquals(True, ex())
        

Here is the call graph for this function:

Definition at line 30 of file test_action_logger.py.

00030 
00031     def testInvokeAddView(self): 
00032         element = getUtility(IRuleAction, name='plone.actions.Logger')
00033         storage = getUtility(IRuleStorage)
00034         storage[u'foo'] = Rule()
00035         rule = self.portal.restrictedTraverse('++rule++foo')
00036         
00037         adding = getMultiAdapter((rule, self.portal.REQUEST), name='+action')
00038         addview = getMultiAdapter((adding, self.portal.REQUEST), name=element.addview)
00039         
00040         addview.createAndAdd(data={'targetLogger' : 'foo', 'loggingLevel' : 10, 'message' : 'bar'})
00041         
00042         e = rule.actions[0]
00043         self.failUnless(isinstance(e, LoggerAction))
00044         self.assertEquals('foo', e.targetLogger)
00045         self.assertEquals(10, e.loggingLevel)
00046         self.assertEquals('bar', e.message)
    

Definition at line 47 of file test_action_logger.py.

00047 
00048     def testInvokeEditView(self): 
00049         element = getUtility(IRuleAction, name='plone.actions.Logger')
00050         e = LoggerAction()
00051         editview = getMultiAdapter((e, self.folder.REQUEST), name=element.editview)
00052         self.failUnless(isinstance(editview, LoggerEditForm))

Definition at line 23 of file test_action_logger.py.

00023 
00024     def testRegistered(self): 
00025         element = getUtility(IRuleAction, name='plone.actions.Logger')
00026         self.assertEquals('plone.actions.Logger', element.addview)
00027         self.assertEquals('edit', element.editview)
00028         self.assertEquals(None, element.for_)
00029         self.assertEquals(None, element.event)
    

The documentation for this class was generated from the following file: