Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testMembersIndexHtml
def testLargePloneFolderHickup
def testSubsequentProfileImportSucceeds
def testFinalStepsWithMembersFolderDeleted
def testExportImportLosesTextIndexes
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 membership
 members
 catalog
 mem_index_type

Detailed Description

Definition at line 904 of file testPortalCreation.py.


Member Function Documentation

Definition at line 906 of file testPortalCreation.py.

00906 
00907     def afterSetUp(self):
00908         self.membership = self.portal.portal_membership
00909         self.members = self.membership.getMembersFolder()
00910         self.catalog = self.portal.portal_catalog
00911         self.mem_index_type = "Script (Python)"
00912         self.setupAuthenticator()

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 962 of file testPortalCreation.py.

00962 
00963     def testExportImportLosesTextIndexes(self):
00964         # Importing a portal .zexp loses text indexes? (#4803)
00965         self.loginAsPortalOwner()
00966         tempfile = mkstemp('.zexp')
00967         tempname = tempfile[1]
00968         try:
00969             # Export the portal
00970             self.portal._p_jar.exportFile(self.portal._p_oid, tempname)
00971             # Nuke it
00972             self.app._delObject(PloneTestCase.portal_name)
00973             # Import the portal
00974             self.app._importObjectFromFile(tempname, set_owner=0)
00975             # Now check the indexes are still present
00976             for index in ('Description', 'Title', 'SearchableText'):
00977                 try:
00978                     self.catalog.Indexes[index]
00979                 except KeyError:
00980                     self.fail('Index %s missing after export/import!' % index)
00981         finally:
00982             os.close(tempfile[0])
00983             os.remove(tempname)
00984 

Here is the call graph for this function:

Definition at line 947 of file testPortalCreation.py.

00947 
00948     def testFinalStepsWithMembersFolderDeleted(self):
00949         # We want the final steps to work even if the 'Members' folder
00950         # is gone
00951         self.loginAsPortalOwner()
00952         portal = self.portal
00953         portal.manage_delObjects(['Members'])
00954         class FakeContext:
00955             def getSite(self):
00956                 return portal
00957             def readDataFile(self, filename):
00958                 return True # Anything other than None runs the step
00959 
00960         setuphandlers.importFinalSteps(FakeContext()) # raises error if fail
00961         self.failUnless(1 == 1)

Here is the call graph for this function:

Definition at line 929 of file testPortalCreation.py.

00929 
00930     def testLargePloneFolderHickup(self):
00931         # Attribute access for 'index_html' acquired the Document from the
00932         # portal instead of returning the local Page Template. This was due to
00933         # special treatment of 'index_html' in the PloneFolder base class and
00934         # got fixed by hazmat.
00935         members = self.members
00936         self.assertEqual(aq_base(members).meta_type, 'ATBTreeFolder')
00937         self.assertEqual(members.index_html.meta_type, self.mem_index_type)

Definition at line 913 of file testPortalCreation.py.

00913 
00914     def testMembersIndexHtml(self):
00915         # index_html for Members folder should be a Page Template
00916         members = self.members
00917         #self.assertEqual(aq_base(members).meta_type, 'Large Plone Folder')
00918         self.assertEqual(aq_base(members).meta_type, 'ATBTreeFolder')
00919         self.failUnless(hasattr(aq_base(members), 'index_html'))
00920         # getitem works
00921         self.assertEqual(aq_base(members)['index_html'].meta_type, self.mem_index_type)
00922         self.assertEqual(members['index_html'].meta_type, self.mem_index_type)
00923         # _getOb works
00924         self.assertEqual(aq_base(members)._getOb('index_html').meta_type, self.mem_index_type)
00925         self.assertEqual(members._getOb('index_html').meta_type, self.mem_index_type)
00926         # getattr works when called explicitly
00927         self.assertEqual(aq_base(members).__getattr__('index_html').meta_type, self.mem_index_type)
00928         self.assertEqual(members.__getattr__('index_html').meta_type, self.mem_index_type)

Definition at line 938 of file testPortalCreation.py.

00938 
00939     def testSubsequentProfileImportSucceeds(self):
00940         # Subsequent profile imports fail (#5439)
00941         self.loginAsPortalOwner()
00942         setup_tool = getToolByName(self.portal, "portal_setup")
00943         # this will raise an error if it fails
00944         profile = setup_tool.getBaselineContextID()
00945         setup_tool.runAllImportStepsFromProfile(profile, purge_old=True)
00946         self.failUnless(1 == 1)

Here is the call graph for this function:


Member Data Documentation

Definition at line 909 of file testPortalCreation.py.

Definition at line 910 of file testPortalCreation.py.

Definition at line 908 of file testPortalCreation.py.

Definition at line 907 of file testPortalCreation.py.


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