Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testPloneTool.TestPortalStatusMessages Class Reference
Inheritance diagram for CMFPlone.tests.testPloneTool.TestPortalStatusMessages:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testPloneTool.TestPortalStatusMessages:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def DISABLED_testPortalMessages
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 utils

Detailed Description

Tests the portal status messages methods

Definition at line 664 of file testPloneTool.py.


Member Function Documentation

Definition at line 667 of file testPloneTool.py.

00667 
00668     def afterSetUp(self):
00669         self.utils = self.portal.plone_utils

Definition at line 672 of file testPloneTool.py.

00672 
00673     def DISABLED_testPortalMessages(self):
00674         # make sure there's no stored message
00675         self.assertEqual(len(self.utils.showPortalMessages()), 0)
00676         # add one message
00677         self.utils.addPortalMessage(u'message', type=u'info')
00678         msgs = self.utils.showPortalMessages()
00679         self.assertEqual(len(msgs), 1)
00680         self.assertEqual(msgs[0].message, u'message')
00681         self.assertEqual(msgs[0].type, u'info')
00682         # make sure messages are removed
00683         msgs = self.utils.showPortalMessages()
00684         self.assertEqual(len(msgs), 0)
00685         # add two messages
00686         self.utils.addPortalMessage(u'message1', type=u'info')
00687         self.utils.addPortalMessage(u'message2', type=u'warning')
00688         msgs = self.utils.showPortalMessages()
00689         self.assertEqual(len(msgs), 2)
00690         self.assertEqual(msgs[0].message, u'message1')
00691         self.assertEqual(msgs[0].type, u'info')
00692         self.assertEqual(msgs[1].message, u'message2')
00693         self.assertEqual(msgs[1].type, u'warning')
00694         # make sure there's no stored message
00695         self.assertEqual(len(self.utils.showPortalMessages()), 0)
00696 

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 668 of file testPloneTool.py.


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