Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
plone.app.workflow.tests.test_remap.TestRemapWorkflow Class Reference
Inheritance diagram for plone.app.workflow.tests.test_remap.TestRemapWorkflow:
Inheritance graph
[legend]
Collaboration diagram for plone.app.workflow.tests.test_remap.TestRemapWorkflow:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_remap_multiple_no_state_map
def test_remap_with_partial_state_map
def test_remap_to_no_workflow
def test_remap_from_no_workflow
def test_remap_to_default

Public Attributes

 catalog
 workflow

Private Member Functions

def _state
def _chain

Detailed Description

Definition at line 9 of file test_remap.py.


Member Function Documentation

Definition at line 34 of file test_remap.py.

00034 
00035     def _chain(self, obj):
00036         return self.workflow.getChainFor(obj)

Here is the caller graph for this function:

Definition at line 31 of file test_remap.py.

00031 
00032     def _state(self, obj):
00033         return self.workflow.getInfoFor(obj, 'review_state')

Here is the caller graph for this function:

Definition at line 11 of file test_remap.py.

00011 
00012     def afterSetUp(self):
00013         self.catalog = self.portal.portal_catalog
00014         self.workflow = self.portal.portal_workflow
00015     
00016         self.setRoles(('Manager',))
00017     
00018         self.workflow.setChainForPortalTypes(('Document','Event',), ('simple_publication_workflow',))
00019         self.workflow.setChainForPortalTypes(('News Item',), ('one_state_workflow',))
00020         self.workflow.setChainForPortalTypes(('Folder',), ())
00021         self.workflow.setChainForPortalTypes(('Image',), None)
00022         
00023         self.portal.invokeFactory('Document', 'd1')
00024         self.portal.invokeFactory('Document', 'd2')
00025         self.folder.invokeFactory('Event', 'e1')
00026         self.folder.invokeFactory('Document', 'e2')
00027         self.portal.invokeFactory('News Item', 'n1')
00028         self.portal.invokeFactory('Image', 'i1')
00029 
00030         self.workflow.doActionFor(self.portal.d1, 'publish')

Definition at line 82 of file test_remap.py.

00082 
00083     def test_remap_from_no_workflow(self):
00084         remap_workflow(self.portal, 
00085                        type_ids=('Image',), 
00086                        chain=('plone_workflow',))
00087                        
00088         self.assertEquals(self._chain(self.portal.i1), ('plone_workflow',))
00089         self.assertEquals(self._state(self.portal.i1), 'visible')
        

Here is the call graph for this function:

Definition at line 37 of file test_remap.py.

00037 
00038     def test_remap_multiple_no_state_map(self):
00039         remap_workflow(self.portal, 
00040                        type_ids=('Document','News Item',), 
00041                        chain=('plone_workflow',))
00042                        
00043         self.assertEquals(self._chain(self.portal.d1), ('plone_workflow',))
00044         self.assertEquals(self._chain(self.portal.d2), ('plone_workflow',))
00045         self.assertEquals(self._chain(self.portal.n1), ('plone_workflow',))
00046                        
00047         self.assertEquals(self._state(self.portal.d1), 'visible')
00048         self.assertEquals(self._state(self.portal.d2), 'visible')
00049         self.assertEquals(self._state(self.portal.n1), 'visible')
        

Here is the call graph for this function:

Definition at line 90 of file test_remap.py.

00090 
00091     def test_remap_to_default(self):
00092         remap_workflow(self.portal, 
00093                        type_ids=('Folder',), 
00094                        chain='(Default)')
00095 
00096         self.assertEquals(self._chain(self.portal.i1), ('plone_workflow',))

Here is the call graph for this function:

Definition at line 64 of file test_remap.py.

00064 
00065     def test_remap_to_no_workflow(self):
00066         
00067         view_at_d1 = [r['name'] for r in self.portal.d1.rolesOfPermission('View') if r['selected']]
00068         self.failUnless('Anonymous' in view_at_d1)
00069         
00070         remap_workflow(self.portal, 
00071                        type_ids=('Document','News Item',), 
00072                        chain=())
00073                        
00074         self.assertEquals(self._chain(self.portal.d1), ())
00075         self.assertEquals(self._chain(self.portal.d2), ())
00076         self.assertEquals(self._chain(self.portal.n1), ())
00077         
00078         view_at_d1 = [r['name'] for r in self.portal.d1.rolesOfPermission('View') if r['selected']]
00079         self.failIf('Anonymous' in view_at_d1)
00080         self.failUnless(self.portal.d1.acquiredRolesAreUsedBy('View'))
00081         
        

Here is the call graph for this function:

Definition at line 50 of file test_remap.py.

00050 
00051     def test_remap_with_partial_state_map(self):
00052         remap_workflow(self.portal, 
00053                        type_ids=('Document','News Item',), 
00054                        chain=('plone_workflow',),
00055                        state_map={'published' : 'published'})
00056                        
00057         self.assertEquals(self._chain(self.portal.d1), ('plone_workflow',))
00058         self.assertEquals(self._chain(self.portal.d2), ('plone_workflow',))
00059         self.assertEquals(self._chain(self.portal.n1), ('plone_workflow',))
00060                        
00061         self.assertEquals(self._state(self.portal.d1), 'published')
00062         self.assertEquals(self._state(self.portal.d2), 'visible')
00063         self.assertEquals(self._state(self.portal.n1), 'published')
        

Here is the call graph for this function:


Member Data Documentation

Definition at line 12 of file test_remap.py.

Definition at line 13 of file test_remap.py.


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