Back to index

plone3  3.1.7
Public Member Functions
plone.portlet.collection.tests.test_portlet_collection.TestPortlet Class Reference
Inheritance diagram for plone.portlet.collection.tests.test_portlet_collection.TestPortlet:
Inheritance graph
[legend]
Collaboration diagram for plone.portlet.collection.tests.test_portlet_collection.TestPortlet:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Detailed Description

Definition at line 20 of file test_portlet_collection.py.


Member Function Documentation

Definition at line 22 of file test_portlet_collection.py.

00022 
00023     def afterSetUp(self):
00024         self.setRoles(('Manager',))

Here is the call graph for this function:

Definition at line 29 of file test_portlet_collection.py.

00029 
00030     def testInterfaces(self):
00031         portlet = collection.Assignment(header=u"title")
00032         self.failUnless(IPortletAssignment.providedBy(portlet))
00033         self.failUnless(IPortletDataProvider.providedBy(portlet.data))

Definition at line 34 of file test_portlet_collection.py.

00034 
00035     def testInvokeAddview(self):
00036         portlet = getUtility(IPortletType, name='plone.portlet.collection.Collection')
00037         mapping = self.portal.restrictedTraverse('++contextportlets++plone.leftcolumn')
00038         for m in mapping.keys():
00039             del mapping[m]
00040         addview = mapping.restrictedTraverse('+/' + portlet.addview)
00041 
00042         addview.createAndAdd(data={'header' : u"test title"})
00043 
00044         self.assertEquals(len(mapping), 1)
00045         self.failUnless(isinstance(mapping.values()[0], collection.Assignment))

Definition at line 46 of file test_portlet_collection.py.

00046 
00047     def testInvokeEditView(self):
00048         mapping = PortletAssignmentMapping()
00049         request = self.folder.REQUEST
00050 
00051         mapping['foo'] = collection.Assignment(header=u"title")
00052         editview = getMultiAdapter((mapping['foo'], request), name='edit')
00053         self.failUnless(isinstance(editview, collection.EditForm))

Definition at line 25 of file test_portlet_collection.py.

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

Definition at line 54 of file test_portlet_collection.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 = collection.Assignment(header=u"title")
00061 
00062         renderer = getMultiAdapter((context, request, view, manager, assignment), IPortletRenderer)
00063         self.failUnless(isinstance(renderer, collection.Renderer))

Here is the call graph for this function:


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