Back to index

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

List of all members.

Public Member Functions

def setUp
def tearDown
def test_getTypeInfo
def test_getActionInfo

Public Attributes

 site

Detailed Description

Definition at line 156 of file test_DynamicType.py.


Member Function Documentation

Definition at line 158 of file test_DynamicType.py.

00158 
00159     def setUp(self):
00160         SecurityRequestTest.setUp(self)
00161         self.site = DummySite('site').__of__(self.root)
00162         self.site._setObject( 'portal_membership', DummyTool() )
00163         self.site._setObject( 'portal_types', TypesTool() )
00164         self.site._setObject( 'portal_url', DummyTool() )
00165         fti = FTIDATA_CMF15[0].copy()
00166         self.site.portal_types._setObject( 'Dummy Content 15', FTI(**fti) )
00167         self.site._setObject( 'foo', DummyContent() )

Definition at line 168 of file test_DynamicType.py.

00168 
00169     def tearDown(self):
00170         cleanUp()
00171         SecurityRequestTest.tearDown(self)

Here is the call graph for this function:

Definition at line 176 of file test_DynamicType.py.

00176 
00177     def test_getActionInfo(self):
00178         foo = self.site.foo
00179         self.assertEqual( foo.getActionInfo('object/view')['id'], 'view' )
00180 
00181         # The following is nasty, but I want to make sure the ValueError
00182         # carries some useful information
00183         INVALID_ID = 'invalid_id'
00184         try:
00185             rval = foo.getActionInfo('object/%s' % INVALID_ID)
00186         except ValueError, e:
00187             message = e.args[0]
00188             detail = '"%s" does not offer action "%s"' % (message, INVALID_ID)
00189             self.failUnless(message.find(INVALID_ID) != -1, detail)
00190 

Definition at line 172 of file test_DynamicType.py.

00172 
00173     def test_getTypeInfo(self):
00174         foo = self.site.foo
00175         self.assertEqual( foo.getTypeInfo().getId(), 'Dummy Content 15' )


Member Data Documentation

Definition at line 160 of file test_DynamicType.py.


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