Back to index

plone3  3.1.7
Public Member Functions
plone.app.portlets.tests.test_events_portlet.TestRenderer Class Reference
Inheritance diagram for plone.app.portlets.tests.test_events_portlet.TestRenderer:
Inheritance graph
[legend]
Collaboration diagram for plone.app.portlets.tests.test_events_portlet.TestRenderer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def renderer
def test_published_events
def test_all_events_link
def test_prev_events_link

Detailed Description

Definition at line 71 of file test_events_portlet.py.


Member Function Documentation

Definition at line 73 of file test_events_portlet.py.

00073 
00074     def afterSetUp(self):
00075         setHooks()
00076         setSite(self.portal)
00077         # Make sure Events use simple_publication_workflow
00078         self.portal.portal_workflow.setChainForPortalTypes(['Event'], ['simple_publication_workflow'])

Here is the call graph for this function:

def plone.app.portlets.tests.test_events_portlet.TestRenderer.renderer (   self,
  context = None,
  request = None,
  view = None,
  manager = None,
  assignment = None 
)

Definition at line 79 of file test_events_portlet.py.

00079 
00080     def renderer(self, context=None, request=None, view=None, manager=None, assignment=None):
00081         context = context or self.folder
00082         request = request or self.folder.REQUEST
00083         view = view or self.folder.restrictedTraverse('@@plone')
00084         manager = manager or getUtility(IPortletManager, name='plone.leftcolumn', context=self.portal)
00085         assignment = assignment or events.Assignment(template='portlet_recent', macro='portlet')
00086 
00087         return getMultiAdapter((context, request, view, manager, assignment), IPortletRenderer)

Here is the call graph for this function:

Definition at line 101 of file test_events_portlet.py.

00101 
00102     def test_all_events_link(self):
00103         r = self.renderer(assignment=events.Assignment(count=5))
00104         self.failUnless(r.all_events_link().endswith('/events'))
00105         self.portal._delObject('events')
00106         r = self.renderer(assignment=events.Assignment(count=5))
00107         self.failUnless(r.all_events_link().endswith('/events_listing'))
        

Here is the call graph for this function:

Definition at line 108 of file test_events_portlet.py.

00108 
00109     def test_prev_events_link(self):
00110         r = self.renderer(assignment=events.Assignment(count=5))
00111         self.failUnless(r.prev_events_link().endswith(
00112             '/events/aggregator/previous'))
00113 
00114         self.loginAsPortalOwner()
00115         self.portal._delObject('events')
00116         self.portal.invokeFactory('Folder', 'events')
00117         self.portal.events.invokeFactory('Folder', 'previous')
00118         r = self.renderer(assignment=events.Assignment(count=5))
00119         self.failUnless(r.prev_events_link().endswith(
00120             '/events/previous'))
00121 
00122         self.portal._delObject('events')
00123         r = self.renderer(assignment=events.Assignment(count=5))
00124         self.assertEquals(None, r.prev_events_link())

Here is the call graph for this function:

Definition at line 88 of file test_events_portlet.py.

00088 
00089     def test_published_events(self):
00090         self.setRoles(('Manager',))
00091         self.portal.invokeFactory('Event', 'e1')
00092         self.portal.invokeFactory('Event', 'e2')
00093         self.portal.portal_workflow.doActionFor(self.portal.e1, 'publish')
00094         
00095         r = self.renderer(assignment=events.Assignment(count=5, state=('draft',)))
00096         self.assertEquals(0, len(r.published_events()))
00097         r = self.renderer(assignment=events.Assignment(count=5, state=('published', )))
00098         self.assertEquals(1, len(r.published_events()))
00099         r = self.renderer(assignment=events.Assignment(count=5, state=('published', 'private',)))
00100         self.assertEquals(2, len(r.published_events()))

Here is the call graph for this function:


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