Back to index

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


Member Function Documentation

Definition at line 20 of file test_login_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 35 of file test_login_portlet.py.

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

Definition at line 40 of file test_login_portlet.py.

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

Definition at line 53 of file test_login_portlet.py.

00053 
00054     def testInvokeEditView(self):
00055         mapping = PortletAssignmentMapping()
00056         request = self.folder.REQUEST
00057 
00058         mapping['foo'] = login.Assignment()
00059         editview = queryMultiAdapter((mapping['foo'], request), name='edit', default=None)
00060         self.failUnless(editview is None)

Definition at line 25 of file test_login_portlet.py.

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

Definition at line 29 of file test_login_portlet.py.

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

Here is the call graph for this function:

Definition at line 61 of file test_login_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.leftcolumn', context=self.portal)
00067         assignment = login.Assignment()
00068 
00069         renderer = getMultiAdapter((context, request, view, manager, assignment), IPortletRenderer)
00070         self.failUnless(isinstance(renderer, login.Renderer))

Here is the call graph for this function:


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