Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFCore.tests.test_Expression.ExpressionTests Class Reference
Inheritance diagram for CMFCore.tests.test_Expression.ExpressionTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_Expression.ExpressionTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def test_anonymous_ec
def test_authenticatedUser_ec
def test_ec_context

Public Attributes

 portal
 folder
 object
 ai

Detailed Description

Definition at line 29 of file test_Expression.py.


Member Function Documentation

Definition at line 31 of file test_Expression.py.

00031 
00032     def setUp( self ):
00033 
00034         SecurityTest.setUp(self)
00035         root = self.root
00036         root._setObject('portal', DummyContent('portal', url='url_portal'))
00037         portal = self.portal = root.portal
00038         self.folder = DummyContent('foo', url='url_foo')
00039         self.object = DummyContent('bar', url='url_bar')
00040         self.ai = ActionInformation(id='view'
00041                                   , title='View'
00042                                   , action=Expression(
00043                   text='view')
00044                                   , condition=Expression(
00045                   text='member')
00046                                   , category='global'
00047                                   , visible=1)

Definition at line 48 of file test_Expression.py.

00048 
00049     def test_anonymous_ec(self):
00050         self.portal.portal_membership = DummyMembershipTool()
00051         ec = createExprContext(self.folder, self.portal, self.object)
00052         member = ec.contexts['member']
00053         self.failIf(member)

Here is the call graph for this function:

Definition at line 54 of file test_Expression.py.

00054 
00055     def test_authenticatedUser_ec(self):
00056         self.portal.portal_membership = DummyMembershipTool(anon=0)
00057         ec = createExprContext(self.folder, self.portal, self.object)
00058         member = ec.contexts['member']
00059         self.assertEqual(member.getId(), 'dummy')

Here is the call graph for this function:

Definition at line 60 of file test_Expression.py.

00060 
00061     def test_ec_context(self):
00062         self.portal.portal_membership = DummyMembershipTool()
00063         ec = createExprContext(self.folder, self.portal, self.object)
00064         object = ec.contexts['object']
00065         portal = ec.contexts['portal']
00066         folder = ec.contexts['folder']
00067         self.failUnless(object)
00068         self.assertEqual(object.id, 'bar')
00069         self.assertEqual(object.absolute_url(), 'url_bar')
00070         self.failUnless(portal)
00071         self.assertEqual(portal.id, 'portal')
00072         self.assertEqual(portal.absolute_url(), 'url_portal')
00073         self.failUnless(folder)
00074         self.assertEqual(folder.id, 'foo')
00075         self.assertEqual(folder.absolute_url(), 'url_foo')
00076 

Here is the call graph for this function:


Member Data Documentation

Definition at line 39 of file test_Expression.py.

Definition at line 37 of file test_Expression.py.

Definition at line 38 of file test_Expression.py.

Definition at line 36 of file test_Expression.py.


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