Back to index

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

List of all members.

Public Member Functions

def afterSetUp
def renderer
def test_published_news_items
def test_all_news_link

Detailed Description

Definition at line 71 of file test_news_portlet.py.


Member Function Documentation

Definition at line 73 of file test_news_portlet.py.

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

Here is the call graph for this function:

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

Definition at line 79 of file test_news_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 news.Assignment(template='portlet_recent', macro='portlet')
00086 
00087         return getMultiAdapter((context, request, view, manager, assignment), IPortletRenderer)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 101 of file test_news_portlet.py.

00101 
00102     def test_all_news_link(self):
00103         r = self.renderer(assignment=news.Assignment(count=5))
00104         self.failUnless(r.all_news_link().endswith('/news'))
00105         self.portal._delObject('news')
00106         self.assertEqual(r.all_news_link(), None)

Here is the call graph for this function:

Definition at line 88 of file test_news_portlet.py.

00088 
00089     def test_published_news_items(self):
00090         self.setRoles(('Manager',))
00091         self.portal.invokeFactory('News Item', 'n1')
00092         self.portal.invokeFactory('News Item', 'n2')
00093         self.portal.portal_workflow.doActionFor(self.portal.n1, 'publish')
00094         
00095         r = self.renderer(assignment=news.Assignment(count=5, state=('draft',)))
00096         self.assertEquals(0, len(r.published_news_items()))
00097         r = self.renderer(assignment=news.Assignment(count=5, state=('published', )))
00098         self.assertEquals(1, len(r.published_news_items()))
00099         r = self.renderer(assignment=news.Assignment(count=5, state=('published', 'private',)))
00100         self.assertEquals(2, len(r.published_news_items()))

Here is the call graph for this function:


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