Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFPlone.tests.testRecentView.TestRecentPortletView Class Reference
Inheritance diagram for CMFPlone.tests.testRecentView.TestRecentPortletView:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testRecentView.TestRecentPortletView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testImplementsIRecentPortlet
def testRecentResults
def testNoRecent
def testRecentResultsPrivate
def testRecentResultsPublicDraft
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Public Attributes

 url
 workflow

Detailed Description

Definition at line 18 of file testRecentView.py.


Member Function Documentation

Definition at line 20 of file testRecentView.py.

00020 
00021     def afterSetUp(self):
00022         self.url = self.portal.portal_url
00023         #self.recent = self.portal.recent
00024         self.workflow = self.portal.portal_workflow
00025         self.setupAuthenticator()

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

RecentPortlet must implement IRecentPortlet

Definition at line 26 of file testRecentView.py.

00026 
00027     def testImplementsIRecentPortlet(self):
00028         """RecentPortlet must implement IRecentPortlet"""
00029         self.failUnless(IRecentPortlet.implementedBy(RecentPortlet))

RecentPortlet.results() must return no content when no recent items

Definition at line 41 of file testRecentView.py.

00041 
00042     def testNoRecent(self):
00043         """RecentPortlet.results() must return no content when no recent items"""
00044            # clear out the catalog to guarantee no results
00045         self.portal.portal_catalog.manage_catalogClear()
00046         view = RecentPortlet(self.portal, self.app.REQUEST)
00047         result = view.results()
00048         return result
00049         self.failUnlessEqual(len(result), 0)

RecentPortlet.results() must return recently updated content

Definition at line 30 of file testRecentView.py.

00030 
00031     def testRecentResults(self):
00032         """RecentPortlet.results() must return recently updated content"""
00033         self.portal.portal_catalog.manage_catalogClear()
00034         self.setRoles(['Manager'])
00035         self.folder.invokeFactory('Document', id='testpage', text='data', title='Foo')
00036         self.workflow.doActionFor(self.folder.testpage, 'publish')
00037         view = RecentPortlet(self.portal, self.app.REQUEST)
00038         result = view.results()
00039         self.failUnlessEqual(len(result), 1)
00040         self.failUnlessEqual(result[0].getId, 'testpage')

Here is the call graph for this function:

RecentPortlet.results() must return private items

Definition at line 50 of file testRecentView.py.

00050 
00051     def testRecentResultsPrivate(self):
00052         """RecentPortlet.results() must return private items"""
00053         self.portal.portal_catalog.manage_catalogClear()
00054         self.setRoles(['Manager'])
00055         self.folder.invokeFactory('Document', id='testpage', text='data', title='Foo')
00056         self.workflow.doActionFor(self.folder.testpage, 'hide')
00057         view = RecentPortlet(self.portal, self.app.REQUEST)
00058         result = view.results()
00059         self.failUnlessEqual(len(result), 1)
00060         self.failUnlessEqual(result[0].getId, 'testpage')

Here is the call graph for this function:

RecentPortlet.results() must return public draft items

Definition at line 61 of file testRecentView.py.

00061 
00062     def testRecentResultsPublicDraft(self):
00063         """RecentPortlet.results() must return public draft items"""
00064         self.portal.portal_catalog.manage_catalogClear()
00065         self.setRoles(['Manager'])
00066         self.folder.invokeFactory('Document', id='testpage', text='data', title='Foo')
00067         view = RecentPortlet(self.portal, self.app.REQUEST)
00068         result = view.results()
00069         self.failUnlessEqual(len(result), 1)
00070         self.failUnlessEqual(result[0].getId, 'testpage')
00071 

Here is the call graph for this function:


Member Data Documentation

Definition at line 21 of file testRecentView.py.

Definition at line 23 of file testRecentView.py.


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