Back to index

plone3  3.1.7
Public Member Functions
plone.app.portlets.tests.test_context.TestBasicContext Class Reference
Inheritance diagram for plone.app.portlets.tests.test_context.TestBasicContext:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.tests.test_context.TestBasicContext:
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 7 of file test_context.py.


Member Function Documentation

Definition at line 51 of file test_context.py.

00051 
00052     def testAnonymous(self):
00053         self.logout()
00054         ctx = IPortletContext(self.folder)
00055         g = ctx.globalPortletCategories()
00056         self.assertEquals(len(g), 2)
00057         self.assertEquals(g[0], ('content_type', 'Folder'))
00058         self.assertEquals(g[1], ('user', 'Anonymous User'))

Here is the call graph for this function:

Definition at line 13 of file test_context.py.

00013 
00014     def testGlobalsNoGroups(self):
00015         ctx = IPortletContext(self.folder)
00016         g = ctx.globalPortletCategories()
00017         self.assertEquals(len(g), 3)
00018         self.assertEquals(g[0], ('content_type', 'Folder'))
00019         self.assertEquals(g[1], ('user', user_name))

Here is the call graph for this function:

Definition at line 34 of file test_context.py.

00034 
00035     def testGlobalsWithMultipleGroup(self):
00036 
00037         self.setRoles(('Manager',))
00038         group = self.portal.portal_groups.getGroupById('Reviewers')
00039         group.addMember(user_name)
00040         group = self.portal.portal_groups.getGroupById('Administrators')
00041         group.addMember(user_name)
00042         self.setRoles(('Member',))
00043 
00044         ctx = IPortletContext(self.folder)
00045         g = ctx.globalPortletCategories()
00046         self.assertEquals(len(g), 5)
00047         self.assertEquals(g[0], ('content_type', 'Folder'))
00048         self.assertEquals(g[1], ('user', user_name))
00049         self.assertEquals(g[2], ('group', 'Administrators'))
00050         self.assertEquals(g[4], ('group', 'Reviewers'))

Here is the call graph for this function:

Definition at line 20 of file test_context.py.

00020 
00021     def testGlobalsWithSingleGroup(self):
00022 
00023         group = self.portal.portal_groups.getGroupById('Reviewers')
00024         self.setRoles(('Manager',))
00025         group.addMember(user_name)
00026         self.setRoles(('Member',))
00027 
00028         ctx = IPortletContext(self.folder)
00029         g = ctx.globalPortletCategories()
00030         self.assertEquals(len(g), 4)
00031         self.assertEquals(g[0], ('content_type', 'Folder'))
00032         self.assertEquals(g[1], ('user', user_name))
00033         self.assertEquals(g[3], ('group', 'Reviewers'))

Here is the call graph for this function:

Definition at line 9 of file test_context.py.

00009 
00010     def testParent(self):
00011         ctx = IPortletContext(self.folder)
00012         self.failUnless(ctx.getParent() is self.folder.aq_parent)

Here is the call graph for this function:


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