Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def testPortalRoot
def testFolderInPortal
def testFolderInFolder
def testDocumentInFolder
def testIndexHtmlInFolder
def testDefaultPageInFolder
def testFolderishIndexHtmlInFolder
def testFolderishDefaultPageInFolder
def testNoFallThroughIndexHtmlInFolder
def testNoFallThroughDefaultPageInFolder
def testNoFallThroughFolderishIndexHtmlInFolder
def testNoFallThroughFolderishDefaultPageInFolder
def testRecursiveDefaultPage
def testNoParentViewPermission
def testNoParentListPermissions
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 f1
 f2

Detailed Description

Definition at line 8 of file testNavigationParent.py.


Member Function Documentation

Definition at line 10 of file testNavigationParent.py.

00010 
00011     def afterSetUp(self):
00012         self.folder.invokeFactory('Folder', 'f1', title = 'Folder 1')
00013         self.f1 = getattr(self.folder, 'f1')
00014         self.f1.invokeFactory('Folder', 'f2', title = 'Folder 2')
00015         self.f2 = getattr(self.f1, 'f2')

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 42 of file testNavigationParent.py.

00042 
00043     def testDefaultPageInFolder(self):
00044         self.f2.invokeFactory('Document', 'd1', title = 'Document 1')
00045         d1 = getattr(self.f2, 'd1')
00046         self.f2.setDefaultPage('d1')
00047         self.assertEqual(d1.navigationParent(), self.f1.absolute_url())
        

Definition at line 28 of file testNavigationParent.py.

00028 
00029     def testDocumentInFolder(self):
00030         self.f1.invokeFactory('Document', 'd1', title = 'Document 1')
00031         d1 = getattr(self.f1, 'd1')
00032         self.assertEqual(d1.navigationParent(), self.f1.absolute_url())
00033         
        

Definition at line 25 of file testNavigationParent.py.

00025 
00026     def testFolderInFolder(self):
00027         self.assertEqual(self.f2.navigationParent(), self.f1.absolute_url())
        

Definition at line 19 of file testNavigationParent.py.

00019 
00020     def testFolderInPortal(self):
00021         self.setRoles(['Manager'])
00022         self.portal.invokeFactory('Folder', 'pf', title = 'portal folder')
00023         pf = getattr(self.portal, 'pf')
00024         self.assertEqual(pf.navigationParent(), self.portal.absolute_url())
        

Here is the call graph for this function:

Definition at line 53 of file testNavigationParent.py.

00053 
00054     def testFolderishDefaultPageInFolder(self):
00055         self.f1.setDefaultPage('f2')
00056         self.assertEqual(self.f2.navigationParent(), self.folder.absolute_url())

Definition at line 48 of file testNavigationParent.py.

00048 
00049     def testFolderishIndexHtmlInFolder(self):
00050         self.f2.invokeFactory('Folder', 'index_html', title = 'Index folder')
00051         ih = getattr(self.f2, 'index_html')
00052         self.assertEqual(ih.navigationParent(), self.f1.absolute_url())
    

Definition at line 37 of file testNavigationParent.py.

00037 
00038     def testIndexHtmlInFolder(self):
00039         self.f2.invokeFactory('Document', 'index_html', title = 'Document 1')
00040         d1 = getattr(self.f2, 'index_html')
00041         self.assertEqual(d1.navigationParent(), self.f1.absolute_url())
        

Definition at line 67 of file testNavigationParent.py.

00067 
00068     def testNoFallThroughDefaultPageInFolder(self):
00069         self.f2.invokeFactory('Document', 'd1', title = 'Document 1')
00070         d1 = getattr(self.f2, 'd1')
00071         self.f2.setDefaultPage('d1')
00072         self.assertEqual(d1.navigationParent(fallThroughDefaultPage=False), 
00073                             self.f2.absolute_url())

Definition at line 80 of file testNavigationParent.py.

00080 
00081     def testNoFallThroughFolderishDefaultPageInFolder(self):
00082         self.f1.setDefaultPage('f2')
00083         self.assertEqual(self.f2.navigationParent(fallThroughDefaultPage=False), 
00084                             self.f1.absolute_url())
                            

Definition at line 74 of file testNavigationParent.py.

00074 
00075     def testNoFallThroughFolderishIndexHtmlInFolder(self):
00076         self.f2.invokeFactory('Folder', 'index_html', title = 'Index folder')
00077         ih = getattr(self.f2, 'index_html')
00078         self.assertEqual(ih.navigationParent(fallThroughDefaultPage=False), 
00079                             self.f2.absolute_url())
        

Definition at line 61 of file testNavigationParent.py.

00061 
00062     def testNoFallThroughIndexHtmlInFolder(self):
00063         self.f2.invokeFactory('Document', 'index_html', title = 'Document 1')
00064         d1 = getattr(self.f2, 'index_html')
00065         self.assertEqual(d1.navigationParent(fallThroughDefaultPage=False), 
00066                             self.f2.absolute_url())

Definition at line 108 of file testNavigationParent.py.

00108 
00109     def testNoParentListPermissions(self):
00110         self.setRoles(['Manager'])
00111         self.portal.invokeFactory('Folder', 'pf', title = 'portal folder')
00112         pf = getattr(self.portal, 'pf')
00113         pf.invokeFactory('Folder', 'lf', title = 'listable folder')
00114         lf = getattr(pf, 'lf')
00115         pf.manage_permission('List folder contents', ['Manager'], 0)
00116         lf.manage_permission('List folder contents', ['Member', 'Manager', 'Owner'], 0)
00117         self.setRoles(['Member'])
00118         
00119         self.failUnless(lf.navigationParent(checkPermissions = ['List folder contents']) is None) 
00120                 

Here is the call graph for this function:

Definition at line 94 of file testNavigationParent.py.

00094 
00095     def testNoParentViewPermission(self):
00096         self.setRoles(['Manager'])
00097         self.portal.invokeFactory('Folder', 'pf', title = 'portal folder')
00098         pf = getattr(self.portal, 'pf')
00099         pf.invokeFactory('Folder', 'lf', title = 'listable folder')
00100         lf = getattr(pf, 'lf')
00101         pf.manage_permission('List folder contents', ['Manager'], 0)
00102         pf.manage_permission('View', ['Manager'], 0)
00103         lf.manage_permission('List folder contents', ['Member', 'Manager', 'Owner'], 0)
00104         lf.manage_permission('View', ['Member', 'Manager', 'Owner'], 0)
00105         self.setRoles(['Member'])
00106         
00107         self.failUnless(lf.navigationParent() is None)
        

Here is the call graph for this function:

Definition at line 16 of file testNavigationParent.py.

00016 
00017     def testPortalRoot(self):
00018         self.failUnless(self.portal.navigationParent() is None)

Definition at line 86 of file testNavigationParent.py.

00086 
00087     def testRecursiveDefaultPage(self):
00088         self.f1.setDefaultPage('f2')
00089         self.f2.invokeFactory('Folder', 'index_html', title = 'index index index')
00090         ih = getattr(self.f2, 'index_html')
00091         self.assertEqual(ih.navigationParent(), self.folder.absolute_url())


Member Data Documentation

Definition at line 12 of file testNavigationParent.py.

Definition at line 14 of file testNavigationParent.py.


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