예제 #1
0
 def testNoRecent(self):
     """RecentPortlet.results() must return no content when no recent items"""
     # clear out the catalog to guarantee no results
     self.portal.portal_catalog.manage_catalogClear()
     view = RecentPortlet(self.portal, self.app.REQUEST)
     result = view.results()
     return result
     self.failUnlessEqual(len(result), 0)
예제 #2
0
 def testRecentResultsPublicDraft(self):
     """RecentPortlet.results() must return public draft items"""
     self.portal.portal_catalog.manage_catalogClear()
     self.setRoles(["Manager"])
     self.folder.invokeFactory("Document", id="testpage", text="data", title="Foo")
     view = RecentPortlet(self.portal, self.app.REQUEST)
     result = view.results()
     self.failUnlessEqual(len(result), 1)
     self.failUnlessEqual(result[0].getId, "testpage")
예제 #3
0
 def testRecentResults(self):
     """RecentPortlet.results() must return recently updated content"""
     self.portal.portal_catalog.manage_catalogClear()
     self.setRoles(["Manager"])
     self.folder.invokeFactory("Document", id="testpage", text="data", title="Foo")
     self.workflow.doActionFor(self.folder.testpage, "publish")
     view = RecentPortlet(self.portal, self.app.REQUEST)
     result = view.results()
     self.failUnlessEqual(len(result), 1)
     self.failUnlessEqual(result[0].getId, "testpage")