Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testMembershipTool.TestMemberareaSetup Class Reference
Inheritance diagram for CMFPlone.tests.testMembershipTool.TestMemberareaSetup:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testMembershipTool.TestMemberareaSetup:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testMemberareaIsPloneFolder
def testMemberareaIsOwnedByMember
def testMemberareaHasDescription
def testMemberareaIsCataloged
def testHomePageNotExists
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 membership
 home

Detailed Description

Definition at line 428 of file testMembershipTool.py.


Member Function Documentation

Definition at line 430 of file testMembershipTool.py.

00430 
00431     def afterSetUp(self):
00432         self.membership = self.portal.portal_membership
00433         self.membership.addMember('user2', 'secret', ['Member'], [])
00434         self.membership.createMemberarea('user2')
00435         self.home = self.membership.getHomeFolder('user2')

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 465 of file testMembershipTool.py.

00465 
00466     def testHomePageNotExists(self):
00467         if self.membership.memberareaCreationFlag == True:
00468             # Should not have an index_html document anymore
00469             self.failIf('index_html' in self.home.objectIds())
00470 

Definition at line 453 of file testMembershipTool.py.

00453 
00454     def testMemberareaHasDescription(self):
00455         # Memberarea should have a description - not in 2.1 ~limi
00456         #self.failUnless(self.home.Description())
00457         pass

Definition at line 458 of file testMembershipTool.py.

00458 
00459     def testMemberareaIsCataloged(self):
00460         if self.membership.memberareaCreationFlag == True:
00461             # Memberarea should be cataloged
00462             catalog = self.portal.portal_catalog
00463             self.failUnless(catalog(id='user2', Type='Folder', Title="user2"),
00464                             "Could not find user2's home folder in the catalog")

Definition at line 442 of file testMembershipTool.py.

00442 
00443     def testMemberareaIsOwnedByMember(self):
00444         if self.membership.memberareaCreationFlag == True:
00445             # Memberarea should be owned by member
00446             try: owner_info = self.home.getOwnerTuple()
00447             except AttributeError:
00448                 owner_info = self.home.getOwner(info=1)
00449             self.assertEqual(owner_info[0], [PloneTestCase.portal_name, 'acl_users'])
00450             self.assertEqual(owner_info[1], 'user2')
00451             self.assertEqual(len(self.home.get_local_roles()), 1)
00452             self.assertEqual(self.home.get_local_roles_for_userid('user2'), ('Owner',))

Definition at line 436 of file testMembershipTool.py.

00436 
00437     def testMemberareaIsPloneFolder(self):
00438         if self.membership.memberareaCreationFlag == True:
00439             # Memberarea should be a Plone folder
00440             self.assertEqual(self.home.meta_type, 'ATFolder')
00441             self.assertEqual(self.home.portal_type, 'Folder')


Member Data Documentation

Definition at line 434 of file testMembershipTool.py.

Definition at line 431 of file testMembershipTool.py.


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