Back to index

plone3  3.1.7
Public Member Functions
plone.app.portlets.tests.test_context.TestPortalRootContext Class Reference
Inheritance diagram for plone.app.portlets.tests.test_context.TestPortalRootContext:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.tests.test_context.TestPortalRootContext:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testParent
def testGlobalsNoGroups
def testGlobalsWithSingleGroup
def testGlobalsWithMultipleGroup
def testAnonymous

Detailed Description

Definition at line 59 of file test_context.py.


Member Function Documentation

Definition at line 103 of file test_context.py.

00103 
00104     def testAnonymous(self):
00105         self.logout()
00106         ctx = IPortletContext(self.portal)
00107         g = ctx.globalPortletCategories()
00108         self.assertEquals(len(g), 2)
00109         self.assertEquals(g[0], ('content_type', 'Plone Site'))
00110         self.assertEquals(g[1], ('user', 'Anonymous User'))

Here is the call graph for this function:

Definition at line 65 of file test_context.py.

00065 
00066     def testGlobalsNoGroups(self):
00067         ctx = IPortletContext(self.portal)
00068         g = ctx.globalPortletCategories()
00069         self.assertEquals(len(g), 3)
00070         self.assertEquals(g[0], ('content_type', 'Plone Site'))
00071         self.assertEquals(g[1], ('user', user_name))

Here is the call graph for this function:

Definition at line 86 of file test_context.py.

00086 
00087     def testGlobalsWithMultipleGroup(self):
00088 
00089         self.setRoles(('Manager',))
00090         group = self.portal.portal_groups.getGroupById('Reviewers')
00091         group.addMember(user_name)
00092         group = self.portal.portal_groups.getGroupById('Administrators')
00093         group.addMember(user_name)
00094         self.setRoles(('Member',))
00095 
00096         ctx = IPortletContext(self.portal)
00097         g = ctx.globalPortletCategories()
00098         self.assertEquals(len(g), 5)
00099         self.assertEquals(g[0], ('content_type', 'Plone Site'))
00100         self.assertEquals(g[1], ('user', user_name))
00101         self.assertEquals(g[2], ('group', 'Administrators'))
00102         self.assertEquals(g[4], ('group', 'Reviewers'))

Here is the call graph for this function:

Definition at line 72 of file test_context.py.

00072 
00073     def testGlobalsWithSingleGroup(self):
00074 
00075         group = self.portal.portal_groups.getGroupById('Reviewers')
00076         self.setRoles(('Manager',))
00077         group.addMember(user_name)
00078         self.setRoles(('Member',))
00079 
00080         ctx = IPortletContext(self.portal)
00081         g = ctx.globalPortletCategories()
00082         self.assertEquals(len(g), 4)
00083         self.assertEquals(g[0], ('content_type', 'Plone Site'))
00084         self.assertEquals(g[1], ('user', user_name))
00085         self.assertEquals(g[3], ('group', 'Reviewers'))

Here is the call graph for this function:

Definition at line 61 of file test_context.py.

00061 
00062     def testParent(self):
00063         ctx = IPortletContext(self.portal)
00064         self.failUnless(ctx.getParent() is None)

Here is the call graph for this function:


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