Back to index

plone3  3.1.7
Public Member Functions
CMFPlone.tests.testPloneFolder.TestPloneFolder Class Reference
Inheritance diagram for CMFPlone.tests.testPloneFolder.TestPloneFolder:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testPloneFolder.TestPloneFolder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testGetObjectPosition
def testGetObjectPositionRaisesNotFound
def testSortOrder
def testEditFolderKeepsPosition
def testRenameFolderKeepsPosition
def testCanViewManagementScreen
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Detailed Description

Definition at line 18 of file testPloneFolder.py.


Member Function Documentation

Definition at line 20 of file testPloneFolder.py.

00020 
00021     def afterSetUp(self):
00022         # Create a bunch of subfolders
00023         self.folder.invokeFactory('Folder', id='sub1')
00024         self.folder.invokeFactory('Folder', id='sub2')
00025         self.folder.invokeFactory('Folder', id='sub3')

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 53 of file testPloneFolder.py.

00053 
00054     def testCanViewManagementScreen(self):
00055         # Make sure the ZMI management screen works
00056         self.folder.manage_main()
00057 

Definition at line 36 of file testPloneFolder.py.

00036 
00037     def testEditFolderKeepsPosition(self):
00038         # Cover http://dev.plone.org/plone/ticket/2796
00039         self.folder.sub2.folder_edit('Foo', 'Description')
00040         self.assertEqual(self.folder.sub2.Title(), 'Foo')
00041         # Order should remain the same
00042         self.assertEqual(self.folder.objectIds(),
00043             ['sub1', 'sub2', 'sub3'])

Definition at line 26 of file testPloneFolder.py.

00026 
00027     def testGetObjectPosition(self):
00028         self.assertEqual(self.folder.getObjectPosition('sub1'), 0)

Definition at line 29 of file testPloneFolder.py.

00029 
00030     def testGetObjectPositionRaisesNotFound(self):
00031         self.assertRaises(NotFound, self.folder.getObjectPosition, 'foobar')

Definition at line 44 of file testPloneFolder.py.

00044 
00045     def testRenameFolderKeepsPosition(self):
00046         # Cover http://dev.plone.org/plone/ticket/2796
00047         transaction.savepoint(optimistic=True) # make rename work
00048         self.folder.sub2.folder_edit('Foo', 'Description', id='foo')
00049         self.assertEqual(self.folder.foo.Title(), 'Foo')
00050         # Order should remain the same
00051         self.assertEqual(self.folder.objectIds(),
00052             ['sub1', 'foo', 'sub3'])

Definition at line 32 of file testPloneFolder.py.

00032 
00033     def testSortOrder(self):
00034         self.assertEqual(self.folder.objectIds(),
00035             ['sub1', 'sub2', 'sub3'])


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