예제 #1
0
 def testExecute(self):
     e = LoggerAction()
     e.targetLogger = 'testing'
     e.loggingLevel = 0
     e.message = 'Test log event'
     ex = getMultiAdapter((self.folder, e, DummyEvent()), IExecutable)
     self.assertTrue(ex())
 def testExecute(self):
     e = LoggerAction()
     e.targetLogger = 'testing'
     e.loggingLevel = 0
     e.message = "Test log event"
     ex = getMultiAdapter((self.folder, e, DummyEvent()), IExecutable)
     self.assertTrue(ex())
예제 #3
0
    def testProcessedMessage(self):
        e = LoggerAction()
        e.targetLogger = 'testing'
        e.loggingLevel = 0
        e.message = 'Test log event'
        ex = getMultiAdapter(
            (self.folder, e, DummyObjectEvent(self.folder)), IExecutable)
        self.assertEqual('Test log event', ex.processedMessage())

        e.message = 'Test log event : &c'
        self.assertEqual(
            'Test log event : '
            '<ATFolder at /plone/Members/{0}>'.format(TEST_USER_ID),
            ex.processedMessage(),
        )

        e.message = 'Test log event : &e'
        self.assertEqual(
            'Test log event : '
            'plone.app.contentrules.tests.test_action_logger.DummyObjectEvent',
            ex.processedMessage(),
        )

        e.message = 'Test log event : &u'
        self.assertEqual(
            'Test log event : {0}'.format(TEST_USER_NAME),
            ex.processedMessage(),
        )
    def testProcessedMessage(self):
        e = LoggerAction()
        e.targetLogger = 'testing'
        e.loggingLevel = 0
        e.message = 'Test log event'
        ex = getMultiAdapter(
            (self.folder, e, DummyObjectEvent(self.folder)), IExecutable)
        self.assertEqual('Test log event', ex.processedMessage())

        e.message = 'Test log event : &c'
        self.assertEqual(
            'Test log event : <Folder at /plone/f1>',
            ex.processedMessage(),
        )

        e.message = 'Test log event : &e'
        self.assertEqual(
            'Test log event : '
            'plone.app.contentrules.tests.test_action_logger.DummyObjectEvent',
            ex.processedMessage(),
        )

        e.message = 'Test log event : &u'
        self.assertEqual(
            'Test log event : {0}'.format(TEST_USER_NAME),
            ex.processedMessage(),
        )
    def testProcessedMessage(self):
        e = LoggerAction()
        e.targetLogger = 'testing'
        e.loggingLevel = 0
        e.message = "Test log event"
        ex = getMultiAdapter((self.folder, e, DummyObjectEvent(self.folder)), IExecutable)
        self.assertEqual("Test log event", ex.processedMessage())

        e.message = "Test log event : &c"
        self.assertEqual("Test log event : <ATFolder at /plone/Members/%s>" % TEST_USER_ID,
                          ex.processedMessage())

        e.message = "Test log event : &e"
        self.assertEqual("Test log event : plone.app.contentrules.tests.test_action_logger.DummyObjectEvent",
                          ex.processedMessage())

        e.message = "Test log event : &u"
        self.assertEqual("Test log event : %s" % TEST_USER_NAME, ex.processedMessage())
예제 #6
0
    def testProcessedMessage(self):
        e = LoggerAction()
        e.targetLogger = 'testing'
        e.loggingLevel = 0
        e.message = "Test log event"
        ex = getMultiAdapter((self.folder, e, DummyObjectEvent(self.folder)),
                             IExecutable)
        self.assertEqual("Test log event", ex.processedMessage())

        e.message = "Test log event : &c"
        self.assertEqual(
            "Test log event : <ATFolder at /plone/Members/%s>" % TEST_USER_ID,
            ex.processedMessage())

        e.message = "Test log event : &e"
        self.assertEqual(
            "Test log event : plone.app.contentrules.tests.test_action_logger.DummyObjectEvent",
            ex.processedMessage())

        e.message = "Test log event : &u"
        self.assertEqual("Test log event : %s" % TEST_USER_NAME,
                         ex.processedMessage())
예제 #7
0
 def testInvokeEditView(self):
     element = getUtility(IRuleAction, name='plone.actions.Logger')
     e = LoggerAction()
     editview = getMultiAdapter(
         (e, self.folder.REQUEST), name=element.editview)
     self.assertTrue(isinstance(editview, LoggerEditFormView))