Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testFolderTitleIsUpdatedOnEdit
def testFolderTitleIsUpdatedOnRename
def testFolderTitleIsUpdatedOnFolderTitleChange
def testFolderTitleIsUpdatedOnFolderRename
def testSetTitleDoesNotUpdateCatalog
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 catalog

Detailed Description

Definition at line 482 of file testCatalogTool.py.


Member Function Documentation

Definition at line 486 of file testCatalogTool.py.

00486 
00487     def afterSetUp(self):
00488         self.catalog = self.portal.portal_catalog
00489         self.folder.invokeFactory('Folder', id='foo')
00490         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 491 of file testCatalogTool.py.

00491 
00492     def testFolderTitleIsUpdatedOnEdit(self):
00493         # Test for catalog that searches to ensure folder titles are
00494         # updated in the catalog.
00495         title = 'Test Folder - Snooze!'
00496         self.folder.foo.folder_edit(title, '')
00497         results = self.catalog(Title='Snooze')
00498         self.failUnless(results)
00499         for result in results:
00500             self.assertEqual(result.Title, title)
00501             self.assertEqual(result.getId, 'foo')

Definition at line 526 of file testCatalogTool.py.

00526 
00527     def testFolderTitleIsUpdatedOnFolderRename(self):
00528         # The bug in fact talks about folder_rename
00529         title = 'Test Folder - Snooze!'
00530         transaction.savepoint(optimistic=True) # make rename work
00531         foo_path = '/'.join(self.folder.foo.getPhysicalPath())
00532         self.setRequestMethod('POST')
00533         self.folder.folder_rename(paths=[foo_path], new_ids=['bar'], new_titles=[title])
00534         results = self.catalog(Title='Snooze')
00535         self.failUnless(results)
00536         for result in results:
00537             self.assertEqual(result.Title, title)
00538             self.assertEqual(result.getId, 'bar')

Here is the call graph for this function:

Definition at line 514 of file testCatalogTool.py.

00514 
00515     def testFolderTitleIsUpdatedOnFolderTitleChange(self):
00516         # The bug in fact talks about folder_rename
00517         title = 'Test Folder - Snooze!'
00518         foo_path = '/'.join(self.folder.foo.getPhysicalPath())
00519         self.setRequestMethod('POST')
00520         self.folder.folder_rename(paths=[foo_path], new_ids=['foo'], new_titles=[title])
00521         results = self.catalog(Title='Snooze')
00522         self.failUnless(results)
00523         for result in results:
00524             self.assertEqual(result.Title, title)
00525             self.assertEqual(result.getId, 'foo')

Here is the call graph for this function:

Definition at line 502 of file testCatalogTool.py.

00502 
00503     def testFolderTitleIsUpdatedOnRename(self):
00504         # Test for catalog that searches to ensure folder titles are
00505         # updated in the catalog.
00506         title = 'Test Folder - Snooze!'
00507         transaction.savepoint(optimistic=True) # make rename work
00508         self.folder.foo.folder_edit(title, '', id='bar')
00509         results = self.catalog(Title='Snooze')
00510         self.failUnless(results)
00511         for result in results:
00512             self.assertEqual(result.Title, title)
00513             self.assertEqual(result.getId, 'bar')

Definition at line 539 of file testCatalogTool.py.

00539 
00540     def testSetTitleDoesNotUpdateCatalog(self):
00541         # setTitle() should not update the catalog
00542         title = 'Test Folder - Snooze!'
00543         self.failUnless(self.catalog(getId='foo'))
00544         self.folder.foo.setTitle(title)
00545         #Title is a TextIndex
00546         self.failIf(self.catalog(Title='Snooze'))
00547 


Member Data Documentation

Definition at line 487 of file testCatalogTool.py.


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