Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
plone.app.contentmenu.tests.TestDisplayViewsMenu Class Reference
Inheritance diagram for plone.app.contentmenu.tests.TestDisplayViewsMenu:
Inheritance graph
[legend]
Collaboration diagram for plone.app.contentmenu.tests.TestDisplayViewsMenu:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def testInterface
def testSimpleAction
def testViewAction
def testNonExisting

Public Attributes

 menu

Private Member Functions

def _getMenuItemByAction

Detailed Description

Definition at line 497 of file tests.py.


Member Function Documentation

Definition at line 508 of file tests.py.

00508 
00509     def _getMenuItemByAction(self, action):
00510         from zope.publisher.browser import TestRequest
00511         context = dummy.Dummy()
00512         request = TestRequest()
00513         return self.menu.getMenuItemByAction(context, request, action)

Here is the caller graph for this function:

Definition at line 499 of file tests.py.

00499 
00500     def setUp(self):
00501         from Products.Five import zcml
00502         import Products.Five
00503         import plone.app.contentmenu
00504         zcml.load_config("meta.zcml", Products.Five)
00505         zcml.load_config('configure.zcml', plone.app.contentmenu)
00506         zcml.load_config('tests.zcml', plone.app.contentmenu)
00507         self.menu = getUtility(IBrowserMenu, 'plone_displayviews')

A DisplayViewsMenu implements an extended interface

Definition at line 514 of file tests.py.

00514 
00515     def testInterface(self):
00516         """A DisplayViewsMenu implements an extended interface"""
00517         from interfaces import IDisplayViewsMenu
00518         self.assertTrue(IDisplayViewsMenu.providedBy(self.menu))

Attempt to retrieve a non-registered IBrowserMenuItem

Definition at line 536 of file tests.py.

00536 
00537     def testNonExisting(self):
00538         """Attempt to retrieve a non-registered IBrowserMenuItem"""
00539         item = self._getMenuItemByAction('nonesuch.html')
00540         self.assertTrue(item is None)
00541 

Here is the call graph for this function:

Retrieve a registered IBrowserMenuItem

Definition at line 519 of file tests.py.

00519 
00520     def testSimpleAction(self):
00521         """Retrieve a registered IBrowserMenuItem"""
00522         item = self._getMenuItemByAction('foo.html')
00523         self.assertFalse(item is None)
00524         self.assertEqual(item.title, 'Test Menu Item')

Here is the call graph for this function:

Retrieve a registered IBrowserMenuItem

Definition at line 525 of file tests.py.

00525 
00526     def testViewAction(self):
00527         """Retrieve a registered IBrowserMenuItem"""
00528         item = self._getMenuItemByAction('bar.html')
00529         self.assertFalse(item is None)
00530         self.assertEqual(item.title, 'Another Test Menu Item')
00531 
00532         item = self._getMenuItemByAction('@@bar.html')
00533         self.assertEqual(item.title, 'Another Test Menu Item')
00534         item = self._getMenuItemByAction('++view++bar.html')
00535         self.assertEqual(item.title, 'Another Test Menu Item')

Here is the call graph for this function:


Member Data Documentation

Definition at line 506 of file tests.py.


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