Back to index

plone3  3.1.7
Public Member Functions
plone.app.portlets.tests.test_recent_portlet.TestPortlet Class Reference
Inheritance diagram for plone.app.portlets.tests.test_recent_portlet.TestPortlet:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.tests.test_recent_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 17 of file test_recent_portlet.py.


Member Function Documentation

Definition at line 19 of file test_recent_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_recent_portlet.py.

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

Definition at line 41 of file test_recent_portlet.py.

00041 
00042     def testInvokeAddview(self):
00043         portlet = getUtility(IPortletType, name='portlets.Recent')
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         addview.createAndAdd(data={})
00050 
00051         self.assertEquals(len(mapping), 1)
00052         self.failUnless(isinstance(mapping.values()[0], recent.Assignment))

Definition at line 53 of file test_recent_portlet.py.

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

Definition at line 24 of file test_recent_portlet.py.

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

Definition at line 28 of file test_recent_portlet.py.

00028 
00029     def testRegisteredInterfaces(self):
00030         portlet = getUtility(IPortletType, name='portlets.Recent')
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 61 of file test_recent_portlet.py.

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

Here is the call graph for this function:


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