Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Attributes
PloneTestCase.testInterfaces.TestFunctionalTestCase Class Reference
Inheritance diagram for PloneTestCase.testInterfaces.TestFunctionalTestCase:
Inheritance graph
[legend]
Collaboration diagram for PloneTestCase.testInterfaces.TestFunctionalTestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def testIFunctional
def testIPortalTestCase
def testIPloneTestCase
def testIPloneSecurity
def getPortal
def createMemberarea
def setRoles
def setGroups
def loginAsPortalOwner
def addProfile
def addProduct

Static Public Attributes

 layer = layer.PloneSite

Private Member Functions

def _portal

Static Private Attributes

int _configure_portal = 0

Detailed Description

Definition at line 43 of file testInterfaces.py.


Member Function Documentation

Returns the portal object for a test.

Reimplemented from PloneTestCase.PloneTestCase.PloneTestCase.

Definition at line 47 of file testInterfaces.py.

00047 
00048     def _portal(self):
00049         return None

def PloneTestCase.PloneTestCase.PloneTestCase.addProduct (   self,
  name 
) [inherited]
Quickinstalls a product into the site.

Definition at line 156 of file PloneTestCase.py.

00156 
00157     def addProduct(self, name):
00158         '''Quickinstalls a product into the site.'''
00159         sm = getSecurityManager()
00160         self.loginAsPortalOwner()
00161         try:
00162             qi = self.portal.portal_quickinstaller
00163             if not qi.isProductInstalled(name):
00164                 qi.installProduct(name)
00165                 self._refreshSkinData()
00166         finally:
00167             setSecurityManager(sm)
00168 

Here is the call graph for this function:

Here is the caller graph for this function:

def PloneTestCase.PloneTestCase.PloneTestCase.addProfile (   self,
  name 
) [inherited]
Imports an extension profile into the site.

Definition at line 134 of file PloneTestCase.py.

00134 
00135     def addProfile(self, name):
00136         '''Imports an extension profile into the site.'''
00137         sm = getSecurityManager()
00138         self.loginAsPortalOwner()
00139         try:
00140             installed = getattr(self.portal, '_installed_profiles', {})
00141             if not installed.has_key(name):
00142                 setup = self.portal.portal_setup
00143                 profile_id = 'profile-%s' % (name,)
00144                 if PLONE30:
00145                     setup.runAllImportStepsFromProfile(profile_id)
00146                 else:
00147                     saved = setup.getImportContextID()
00148                     try:
00149                         setup.setImportContext(profile_id)
00150                         setup.runAllImportSteps()
00151                     finally:
00152                         setup.setImportContext(saved)
00153                 self._refreshSkinData()
00154         finally:
00155             setSecurityManager(sm)

Here is the call graph for this function:

def PloneTestCase.PloneTestCase.PloneTestCase.createMemberarea (   self,
  name 
) [inherited]
Creates a minimal memberarea.

Definition at line 96 of file PloneTestCase.py.

00096 
00097     def createMemberarea(self, name):
00098         '''Creates a minimal memberarea.'''
00099         _createHomeFolder(self.portal, name)

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the portal object.

   Do not call this method! Use the self.portal
   attribute to access the portal object from tests.

Definition at line 88 of file PloneTestCase.py.

00088 
00089     def getPortal(self):
00090         '''Returns the portal object.
00091 
00092            Do not call this method! Use the self.portal
00093            attribute to access the portal object from tests.
00094         '''
00095         return getattr(self.app, portal_name)

Here is the caller graph for this function:

Use if - AND ONLY IF - you need to manipulate
   the portal object itself.

Definition at line 122 of file PloneTestCase.py.

00122 
00123     def loginAsPortalOwner(self):
00124         '''Use if - AND ONLY IF - you need to manipulate
00125            the portal object itself.
00126         '''
00127         uf = self.app.acl_users
00128         user = uf.getUserById(portal_owner)
00129         if not hasattr(user, 'aq_base'):
00130             user = user.__of__(uf)
00131         newSecurityManager(None, user)

def PloneTestCase.PloneTestCase.PloneTestCase.setGroups (   self,
  groups,
  name = default_user 
) [inherited]
Changes the user's groups.

Definition at line 112 of file PloneTestCase.py.

00112 
00113     def setGroups(self, groups, name=default_user):
00114         '''Changes the user's groups.'''
00115         uf = self.portal.acl_users
00116         if PLONE25:
00117             uf.userSetGroups(name, utils.makelist(groups))
00118         else:
00119             uf._updateUser(name, groups=utils.makelist(groups))
00120         if name == getSecurityManager().getUser().getId():
00121             self.login(name)

Here is the call graph for this function:

Here is the caller graph for this function:

def PloneTestCase.PloneTestCase.PloneTestCase.setRoles (   self,
  roles,
  name = default_user 
) [inherited]
Changes the user's roles.

Definition at line 102 of file PloneTestCase.py.

00102 
00103     def setRoles(self, roles, name=default_user):
00104         '''Changes the user's roles.'''
00105         uf = self.portal.acl_users
00106         if PLONE25:
00107             uf.userFolderEditUser(name, None, utils.makelist(roles), [])
00108         else:
00109             uf._updateUser(name, roles=utils.makelist(roles))
00110         if name == getSecurityManager().getUser().getId():
00111             self.login(name)

Here is the call graph for this function:

Definition at line 50 of file testInterfaces.py.

00050 
00051     def testIFunctional(self):
00052         self.failUnless(verifyClass(IFunctional, PloneTestCase.FunctionalTestCase))
00053         self.failUnless(verifyObject(IFunctional, self))

Definition at line 62 of file testInterfaces.py.

00062 
00063     def testIPloneSecurity(self):
00064         self.failUnless(verifyClass(IPloneSecurity, PloneTestCase.FunctionalTestCase))
00065         self.failUnless(verifyObject(IPloneSecurity, self))
00066 

Definition at line 58 of file testInterfaces.py.

00058 
00059     def testIPloneTestCase(self):
00060         self.failUnless(verifyClass(IPloneTestCase, PloneTestCase.FunctionalTestCase))
00061         self.failUnless(verifyObject(IPloneTestCase, self))

Definition at line 54 of file testInterfaces.py.

00054 
00055     def testIPortalTestCase(self):
00056         self.failUnless(verifyClass(IPortalTestCase, PloneTestCase.FunctionalTestCase))
00057         self.failUnless(verifyObject(IPortalTestCase, self))


Member Data Documentation

Definition at line 45 of file testInterfaces.py.

Definition at line 65 of file PloneTestCase.py.


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