Back to index

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


Member Function Documentation

Definition at line 20 of file test_review_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_review_portlet.py.

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

Definition at line 42 of file test_review_portlet.py.

00042 
00043     def testInvokeAddview(self):
00044         portlet = getUtility(IPortletType, name='portlets.Review')
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         # This is a NullAddForm - calling it does the work
00051         addview()
00052 
00053         self.assertEquals(len(mapping), 1)
00054         self.failUnless(isinstance(mapping.values()[0], review.Assignment))

Definition at line 25 of file test_review_portlet.py.

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

Definition at line 29 of file test_review_portlet.py.

00029 
00030     def testRegisteredInterfaces(self):
00031         portlet = getUtility(IPortletType, name='portlets.Review')
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 55 of file test_review_portlet.py.

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

Here is the call graph for this function:


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