Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFCore.tests.test_ActionInformation.ActionTests Class Reference

List of all members.

Public Member Functions

def test_z3interfaces
def test_getInfoData_empty
def test_getInfoData_normal
def test_manage_propertiesForm_allows_adding

Private Member Functions

def _makeOne

Detailed Description

Definition at line 59 of file test_ActionInformation.py.


Member Function Documentation

def CMFCore.tests.test_ActionInformation.ActionTests._makeOne (   self,
  args,
  kw 
) [private]

Definition at line 61 of file test_ActionInformation.py.

00061 
00062     def _makeOne(self, *args, **kw):
00063         from Products.CMFCore.ActionInformation import Action
00064 
00065         return Action(*args, **kw)

Definition at line 73 of file test_ActionInformation.py.

00073 
00074     def test_getInfoData_empty(self):
00075         WANTED = ( {'available': True, 'category': '', 'description': '',
00076                     'id': 'foo', 'icon': '', 'permissions': (), 'title': '',
00077                     'url': '', 'visible': True}, [] )
00078         a = self._makeOne('foo')
00079         self.assertEqual( a.getInfoData(), WANTED )

Here is the call graph for this function:

Definition at line 80 of file test_ActionInformation.py.

00080 
00081     def test_getInfoData_normal(self):
00082         a = self._makeOne('foo',
00083                           title='Foo Title',
00084                           description='Foo description.',
00085                           url_expr='string:${object_url}/foo_url',
00086                           icon_expr='string:foo_icon',
00087                           available_expr='',
00088                           permissions=('View',),
00089                           visible=False)
00090         WANTED = ( {'available': True, 'category': '',
00091                     'description': 'Foo description.',
00092                     'id': 'foo', 'icon': a.icon_expr_object,
00093                     'permissions': ('View',), 'title': 'Foo Title',
00094                     'url': a.url_expr_object, 'visible': False},
00095                    ['url', 'icon'] )
00096         self.assertEqual( a.getInfoData(), WANTED )

Here is the call graph for this function:

Definition at line 97 of file test_ActionInformation.py.

00097 
00098     def test_manage_propertiesForm_allows_adding(self):
00099         from OFS.SimpleItem import SimpleItem
00100         def _header(*args, **kw):
00101             return 'HEADER'
00102         def _footer(*args, **kw):
00103             return 'HEADER'
00104         container = SimpleItem()
00105 
00106         container.REQUEST = request = DummyRequest()
00107         request.set('manage_page_header', _header)
00108         request.set('manage_page_footer', _footer)
00109         request.set('BASEPATH1', '/one/two')
00110         request.set('URL1', '/one/two')
00111         request._steps = ['one', 'two']
00112 
00113         prd = {'ac_permissions': ('a', 'b')}
00114         container._getProductRegistryData = prd.get
00115 
00116         a = self._makeOne('extensible').__of__(container)
00117         form_html = a.manage_propertiesForm(request)
00118 
00119         self.failUnless('value=" Add "' in form_html)

Here is the call graph for this function:

Definition at line 66 of file test_ActionInformation.py.

00066 
00067     def test_z3interfaces(self):
00068         from zope.interface.verify import verifyClass
00069         from Products.CMFCore.ActionInformation import Action
00070         from Products.CMFCore.interfaces import IAction
00071 
00072         verifyClass(IAction, Action)


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