Back to index

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

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 17 of file test_calendar_portlet.py.


Member Function Documentation

Definition at line 19 of file test_calendar_portlet.py.

00019 
00020     def afterSetUp(self):
00021         setHooks()
00022         setSite(self.portal)
00023         self.setRoles(('Manager',))

Here is the call graph for this function:

Definition at line 36 of file test_calendar_portlet.py.

00036 
00037     def testInterfaces(self):
00038         portlet = calendar.Assignment()
00039         self.failUnless(IPortletAssignment.providedBy(portlet))
00040         self.failUnless(IPortletDataProvider.providedBy(portlet.data))

Definition at line 41 of file test_calendar_portlet.py.

00041 
00042     def testInvokeAddview(self):
00043         portlet = getUtility(IPortletType, name='portlets.Calendar')
00044         mapping = self.portal.restrictedTraverse('++contextportlets++plone.leftcolumn')
00045         for m in mapping.keys():
00046             del mapping[m]
00047         addview = mapping.restrictedTraverse('+/' + portlet.addview)
00048 
00049         # This is a NullAddForm - calling it does the work
00050         addview()
00051 
00052         self.assertEquals(len(mapping), 1)
00053         self.failUnless(isinstance(mapping.values()[0], calendar.Assignment))

Definition at line 24 of file test_calendar_portlet.py.

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

Definition at line 28 of file test_calendar_portlet.py.

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

Here is the call graph for this function:

Definition at line 54 of file test_calendar_portlet.py.

00054 
00055     def testRenderer(self):
00056         context = self.folder
00057         request = self.folder.REQUEST
00058         view = self.folder.restrictedTraverse('@@plone')
00059         manager = getUtility(IPortletManager, name='plone.rightcolumn', context=self.portal)
00060         assignment = calendar.Assignment()
00061 
00062         renderer = getMultiAdapter((context, request, view, manager, assignment), IPortletRenderer)
00063         self.failUnless(isinstance(renderer, calendar.Renderer))

Here is the call graph for this function:


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