Back to index

plone3  3.1.7
Public Member Functions
plone.app.portlets.tests.test_classic_portlet.TestPortlet Class Reference
Inheritance diagram for plone.app.portlets.tests.test_classic_portlet.TestPortlet:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.tests.test_classic_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_classic_portlet.py.


Member Function Documentation

Definition at line 20 of file test_classic_portlet.py.

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

Here is the call graph for this function:

Definition at line 37 of file test_classic_portlet.py.

00037 
00038     def testInterfaces(self):
00039         portlet = classic.Assignment(template='portlet_recent', macro='portlet')
00040         self.failUnless(IPortletAssignment.providedBy(portlet))
00041         self.failUnless(IPortletDataProvider.providedBy(portlet.data))

Definition at line 42 of file test_classic_portlet.py.

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

Definition at line 54 of file test_classic_portlet.py.

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

Definition at line 25 of file test_classic_portlet.py.

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

Definition at line 29 of file test_classic_portlet.py.

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

Here is the call graph for this function:

Definition at line 62 of file test_classic_portlet.py.

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

Here is the call graph for this function:


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