Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
Archetypes.tests.test_cmfessentials.TestPermissions Class Reference
Inheritance diagram for Archetypes.tests.test_cmfessentials.TestPermissions:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.tests.test_cmfessentials.TestPermissions:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testPermissions
def testRendering

Public Attributes

 demo_instances

Static Public Attributes

list demo_types

Detailed Description

Definition at line 38 of file test_cmfessentials.py.


Member Function Documentation

Definition at line 42 of file test_cmfessentials.py.

00042 
00043     def afterSetUp(self):
00044         ATSiteTestCase.afterSetUp(self)
00045         # install AT within portal
00046         self.login()
00047         self.demo_instances = []
00048         for t in self.demo_types:
00049             # XXX: Fails with "Unauthorized" exception from
00050             #      CMFDefault/DiscussionTool.py:84, in overrideDiscussionFor
00051             #
00052             #      Note that BaseObject.initializeArchetype has a bare except
00053             #      that prints out the error instead of letting it through, so
00054             #      that there is no exception when running the test.
00055             inst = makeContent(self.folder, portal_type=t, id=t)
00056             self.demo_instances.append(inst)

Here is the call graph for this function:

Definition at line 57 of file test_cmfessentials.py.

00057 
00058     def testPermissions(self):
00059         for content in self.demo_instances:
00060             # XXX: Strangely enough we have correct permissions here, but not so
00061             #      in initializeArchetype
00062             self.failUnless(checkPerm(permissions.View, content))
00063             self.failUnless(checkPerm(permissions.AccessContentsInformation, content))
00064             self.failUnless(checkPerm(permissions.ModifyPortalContent, content))

Definition at line 65 of file test_cmfessentials.py.

00065 
00066     def testRendering(self):
00067         # Attempt to call each object and make sure it presents a rendered
00068         # html view
00069         for content in self.demo_instances:
00070             self.failUnless(isinstance(content(), basestring))
00071             self.failUnless(content().strip().startswith('<!DOCTYPE'))
00072 

Here is the call graph for this function:


Member Data Documentation

Definition at line 46 of file test_cmfessentials.py.

Initial value:
['DDocument', 'SimpleType', 'SimpleFolder',
                  'Fact', 'ComplexType']

Definition at line 39 of file test_cmfessentials.py.


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