Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def populateSite
def testCreateBreadCrumbs
def testBreadcrumbsRespectTypesWithViewAction
def testBreadcrumbsStopAtNavigationRoot
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 request

Static Public Attributes

 view_class = CatalogNavigationBreadcrumbs

Detailed Description

Definition at line 713 of file testNavigationView.py.


Member Function Documentation

Definition at line 672 of file testNavigationView.py.

00672 
00673     def afterSetUp(self):
00674         self.request = self.app.REQUEST
00675         setDefaultSkin(self.request)
00676         self.populateSite()

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 677 of file testNavigationView.py.

00677 
00678     def populateSite(self):
00679         self.setRoles(['Manager'])
00680         self.portal.invokeFactory('Folder', 'folder1')
00681         folder1 = getattr(self.portal, 'folder1')
00682         folder1.invokeFactory('Document', 'doc11')
00683         folder1.invokeFactory('File', 'file11')
00684         self.setRoles(['Member'])

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 695 of file testNavigationView.py.

00695 
00696     def testBreadcrumbsRespectTypesWithViewAction(self):
00697         # With a type in typesUseViewActionInListings as current action it
00698         # should return a breadcrumb which has '/view' appended to the url
00699         file = self.portal.folder1.file11
00700         view = self.view_class(self.portal.folder1.file11, self.request)
00701         crumbs = view.breadcrumbs()
00702         self.failUnless(crumbs)
00703         self.assertEqual(crumbs[-1]['absolute_url'][-5:],'/view')
        

Definition at line 704 of file testNavigationView.py.

00704 
00705     def testBreadcrumbsStopAtNavigationRoot(self):
00706         ntp=self.portal.portal_properties.navtree_properties
00707         ntp.manage_changeProperties(topLevel=1, root='/folder1')
00708         view = self.view_class(self.portal.folder1.doc11, self.request)
00709         crumbs = view.breadcrumbs()
00710         self.failUnless(crumbs)
00711         self.assertEqual(crumbs[0]['absolute_url'], self.portal.folder1.doc11.absolute_url())
00712 

Definition at line 685 of file testNavigationView.py.

00685 
00686     def testCreateBreadCrumbs(self):
00687         # See if we can create one at all
00688         doc = self.portal.folder1.doc11
00689         view = self.view_class(doc, self.request)
00690         crumbs = view.breadcrumbs()
00691         self.failUnless(crumbs)
00692         self.assertEqual(len(crumbs), 2)
00693         self.assertEqual(crumbs[-1]['absolute_url'], doc.absolute_url())
00694         self.assertEqual(crumbs[-2]['absolute_url'], doc.aq_parent.absolute_url())


Member Data Documentation

Definition at line 673 of file testNavigationView.py.

Reimplemented from CMFPlone.tests.testNavigationView.TestBaseBreadCrumbs.

Definition at line 714 of file testNavigationView.py.


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