Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def getPermissionsOfRole
def construct
def createWithoutConstruction
def testPortalTypeName
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 types

Detailed Description

Definition at line 20 of file testContentTypes.py.


Member Function Documentation

Definition at line 22 of file testContentTypes.py.

00022 
00023     def afterSetUp(self):
00024         perms = self.getPermissionsOfRole('Member')
00025         self.setPermissions(perms + [AddPortalTopics], 'Member')
00026         self.types = self.portal.portal_types

Here is the call graph for this function:

def CMFPlone.tests.testContentTypes.TestATContentTypes.construct (   self,
  portal_type,
  id,
  folder 
)

Definition at line 31 of file testContentTypes.py.

00031 
00032     def construct(self, portal_type, id, folder):
00033         fti = self.types.getTypeInfo(portal_type)
00034         fti.constructInstance(folder, id=id)
00035         return getattr(folder, id)

Here is the caller graph for this function:

def CMFPlone.tests.testContentTypes.TestATContentTypes.createWithoutConstruction (   self,
  portal_type,
  id,
  folder 
)

Definition at line 36 of file testContentTypes.py.

00036 
00037     def createWithoutConstruction(self, portal_type, id, folder):
00038         fti = self.types.getTypeInfo(portal_type)
00039         # manual creation
00040         p = folder.manage_addProduct[fti.product]
00041         m = getattr(p, fti.factory)
00042         m(id) # create it
00043         return folder._getOb(id)

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:

Definition at line 27 of file testContentTypes.py.

00027 
00028     def getPermissionsOfRole(self, role):
00029         perms = self.portal.permissionsOfRole(role)
00030         return [p['name'] for p in perms if p['selected']]

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 44 of file testContentTypes.py.

00044 
00045     def testPortalTypeName(self):
00046         for pt in atct_types:
00047             ob = self.construct(pt, pt, self.folder)
00048             self.failUnlessEqual(ob._getPortalTypeName(), pt)
00049             self.failUnlessEqual(ob.portal_type, pt)
00050             self.failUnless(IATContentType.isImplementedBy(ob))
00051 

Here is the call graph for this function:


Member Data Documentation

Definition at line 25 of file testContentTypes.py.


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