Back to index

plone3  3.1.7
Public Member Functions
plone.app.portlets.tests.test_navigation_portlet.TestPortlet Class Reference
Inheritance diagram for plone.app.portlets.tests.test_navigation_portlet.TestPortlet:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.tests.test_navigation_portlet.TestPortlet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testPortletTypeRegistered
def testRegisteredInterfaces
def testInterfaces
def testInvokeAddview
def testInvokeEditView
def testRenderer

Detailed Description

Definition at line 18 of file test_navigation_portlet.py.


Member Function Documentation

Definition at line 20 of file test_navigation_portlet.py.

00020 
00021     def afterSetUp(self):
00022         self.setRoles(('Manager',))

Here is the call graph for this function:

Definition at line 34 of file test_navigation_portlet.py.

00034 
00035     def testInterfaces(self):
00036         portlet = navigation.Assignment()
00037         self.failUnless(IPortletAssignment.providedBy(portlet))
00038         self.failUnless(IPortletDataProvider.providedBy(portlet.data))

Definition at line 39 of file test_navigation_portlet.py.

00039 
00040     def testInvokeAddview(self):
00041         portlet = getUtility(IPortletType, name='portlets.Navigation')
00042         mapping = self.portal.restrictedTraverse('++contextportlets++plone.leftcolumn')
00043         for m in mapping.keys():
00044             del mapping[m]
00045         addview = mapping.restrictedTraverse('+/' + portlet.addview)
00046 
00047         addview.createAndAdd(data={})
00048 
00049         self.assertEquals(len(mapping), 1)
00050         self.failUnless(isinstance(mapping.values()[0], navigation.Assignment))

Definition at line 51 of file test_navigation_portlet.py.

00051 
00052     def testInvokeEditView(self):
00053         mapping = PortletAssignmentMapping()
00054         request = self.folder.REQUEST
00055 
00056         mapping['foo'] = navigation.Assignment()
00057         editview = getMultiAdapter((mapping['foo'], request), name='edit')
00058         self.failUnless(isinstance(editview, navigation.EditForm))

Definition at line 23 of file test_navigation_portlet.py.

00023 
00024     def testPortletTypeRegistered(self):
00025         portlet = getUtility(IPortletType, name='portlets.Navigation')
00026         self.assertEquals(portlet.addview, 'portlets.Navigation')

Definition at line 27 of file test_navigation_portlet.py.

00027 
00028     def testRegisteredInterfaces(self):
00029         portlet = getUtility(IPortletType, name='portlets.Navigation')
00030         registered_interfaces = [_getDottedName(i) for i in portlet.for_] 
00031         registered_interfaces.sort() 
00032         self.assertEquals(['plone.app.portlets.interfaces.IColumn'],
00033           registered_interfaces)

Here is the call graph for this function:

Definition at line 59 of file test_navigation_portlet.py.

00059 
00060     def testRenderer(self):
00061         context = self.folder
00062         request = self.folder.REQUEST
00063         view = self.folder.restrictedTraverse('@@plone')
00064         manager = getUtility(IPortletManager, name='plone.leftcolumn', context=self.portal)
00065         assignment = navigation.Assignment()
00066 
00067         renderer = getMultiAdapter((context, request, view, manager, assignment), IPortletRenderer)
00068         self.failUnless(isinstance(renderer, navigation.Renderer))

Here is the call graph for this function:


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