Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Static Private Attributes
CMFCore.exportimport.tests.test_workflow.importWorkflowToolTests Class Reference
Inheritance diagram for CMFCore.exportimport.tests.test_workflow.importWorkflowToolTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.exportimport.tests.test_workflow.importWorkflowToolTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_empty_default_purge
def test_empty_explicit_purge
def test_empty_skip_purge
def test_bindings_skip_purge
def test_fragment_skip_purge

Static Public Attributes

 layer = ExportImportZCMLLayer

Static Private Attributes

 _BINDINGS_TOOL_EXPORT = _BINDINGS_TOOL_EXPORT
 _EMPTY_TOOL_EXPORT = _EMPTY_TOOL_EXPORT
 _FRAGMENT_IMPORT = _FRAGMENT_IMPORT

Detailed Description

Definition at line 208 of file test_workflow.py.


Member Function Documentation

Definition at line 297 of file test_workflow.py.

00297 
00298     def test_bindings_skip_purge(self):
00299         from Products.CMFCore.exportimport.workflow import importWorkflowTool
00300 
00301         WF_ID_NON = 'non_dcworkflow_%s'
00302         WF_TITLE_NON = 'Non-DCWorkflow #%s'
00303 
00304         site = self._initSite()
00305         wf_tool = site.portal_workflow
00306 
00307         for i in range(4):
00308             nondcworkflow = DummyWorkflow(WF_TITLE_NON % i)
00309             nondcworkflow.title = WF_TITLE_NON % i
00310             wf_tool._setObject(WF_ID_NON % i, nondcworkflow)
00311 
00312         wf_tool._default_chain = (WF_ID_NON % 1,)
00313         wf_tool._chains_by_type['sometype'] = (WF_ID_NON % 2,)
00314         self.assertEqual(len(wf_tool.objectIds()), 4)
00315 
00316         context = DummyImportContext(site, False)
00317         context._files['workflows.xml'] = self._BINDINGS_TOOL_EXPORT
00318         importWorkflowTool(context)
00319 
00320         self.assertEqual(len(wf_tool.objectIds()), 4)
00321         self.assertEqual(len(wf_tool._default_chain), 2)
00322         self.assertEqual(wf_tool._default_chain[0], WF_ID_NON % 0)
00323         self.assertEqual(wf_tool._default_chain[1], WF_ID_NON % 1)
00324         self.assertEqual(len(wf_tool._chains_by_type), 2)
00325         self.assertEqual(wf_tool._chains_by_type['sometype'],
00326                          (WF_ID_NON % 2,))
00327         self.assertEqual(wf_tool._chains_by_type['anothertype'],
00328                          (WF_ID_NON % 3,))

Here is the call graph for this function:

Definition at line 216 of file test_workflow.py.

00216 
00217     def test_empty_default_purge(self):
00218         from Products.CMFCore.exportimport.workflow import importWorkflowTool
00219 
00220         WF_ID_NON = 'non_dcworkflow_%s'
00221         WF_TITLE_NON = 'Non-DCWorkflow #%s'
00222 
00223         site = self._initSite()
00224         wf_tool = site.portal_workflow
00225 
00226         for i in range(4):
00227             nondcworkflow = DummyWorkflow(WF_TITLE_NON % i)
00228             nondcworkflow.title = WF_TITLE_NON % i
00229             wf_tool._setObject(WF_ID_NON % i, nondcworkflow)
00230 
00231         wf_tool._default_chain = (WF_ID_NON % 1,)
00232         wf_tool._chains_by_type['sometype'] = (WF_ID_NON % 2,)
00233         self.assertEqual(len(wf_tool.objectIds()), 4)
00234 
00235         context = DummyImportContext(site)
00236         context._files['workflows.xml'] = self._EMPTY_TOOL_EXPORT
00237         importWorkflowTool(context)
00238 
00239         self.assertEqual(len(wf_tool.objectIds()), 0)
00240         self.assertEqual(len(wf_tool._default_chain), 0)
00241         self.assertEqual(len(wf_tool._chains_by_type), 0)

Here is the call graph for this function:

Definition at line 242 of file test_workflow.py.

00242 
00243     def test_empty_explicit_purge(self):
00244         from Products.CMFCore.exportimport.workflow import importWorkflowTool
00245 
00246         WF_ID_NON = 'non_dcworkflow_%s'
00247         WF_TITLE_NON = 'Non-DCWorkflow #%s'
00248 
00249         site = self._initSite()
00250         wf_tool = site.portal_workflow
00251 
00252         for i in range(4):
00253             nondcworkflow = DummyWorkflow(WF_TITLE_NON % i)
00254             nondcworkflow.title = WF_TITLE_NON % i
00255             wf_tool._setObject(WF_ID_NON % i, nondcworkflow)
00256 
00257         wf_tool._default_chain = (WF_ID_NON % 1,)
00258         wf_tool._chains_by_type['sometype'] = (WF_ID_NON % 2,)
00259         self.assertEqual(len(wf_tool.objectIds()), 4)
00260 
00261         context = DummyImportContext(site, True)
00262         context._files['workflows.xml'] = self._EMPTY_TOOL_EXPORT
00263         importWorkflowTool(context)
00264 
00265         self.assertEqual(len(wf_tool.objectIds()), 0)
00266         self.assertEqual(len(wf_tool._default_chain), 0)
00267         self.assertEqual(len(wf_tool._chains_by_type), 0)

Here is the call graph for this function:

Definition at line 268 of file test_workflow.py.

00268 
00269     def test_empty_skip_purge(self):
00270         from Products.CMFCore.exportimport.workflow import importWorkflowTool
00271 
00272         WF_ID_NON = 'non_dcworkflow_%s'
00273         WF_TITLE_NON = 'Non-DCWorkflow #%s'
00274 
00275         site = self._initSite()
00276         wf_tool = site.portal_workflow
00277 
00278         for i in range(4):
00279             nondcworkflow = DummyWorkflow(WF_TITLE_NON % i)
00280             nondcworkflow.title = WF_TITLE_NON % i
00281             wf_tool._setObject(WF_ID_NON % i, nondcworkflow)
00282 
00283         wf_tool._default_chain = (WF_ID_NON % 1,)
00284         wf_tool._chains_by_type['sometype'] = (WF_ID_NON % 2,)
00285         self.assertEqual(len(wf_tool.objectIds()), 4)
00286 
00287         context = DummyImportContext(site, False)
00288         context._files['typestool.xml'] = self._EMPTY_TOOL_EXPORT
00289         importWorkflowTool(context)
00290 
00291         self.assertEqual(len(wf_tool.objectIds()), 4)
00292         self.assertEqual(len(wf_tool._default_chain), 1)
00293         self.assertEqual(wf_tool._default_chain[0], WF_ID_NON % 1)
00294         self.assertEqual(len(wf_tool._chains_by_type), 1)
00295         self.assertEqual(wf_tool._chains_by_type['sometype'],
00296                          (WF_ID_NON % 2,))

Here is the call graph for this function:

Definition at line 329 of file test_workflow.py.

00329 
00330     def test_fragment_skip_purge(self):
00331         from Products.CMFCore.exportimport.workflow import importWorkflowTool
00332 
00333         WF_ID_NON = 'non_dcworkflow_%s'
00334         WF_TITLE_NON = 'Non-DCWorkflow #%s'
00335 
00336         site = self._initSite()
00337         wf_tool = site.portal_workflow
00338 
00339         for i in range(4):
00340             nondcworkflow = DummyWorkflow(WF_TITLE_NON % i)
00341             nondcworkflow.title = WF_TITLE_NON % i
00342             wf_tool._setObject(WF_ID_NON % i, nondcworkflow)
00343 
00344         wf_tool._default_chain = (WF_ID_NON % 1,)
00345         wf_tool._chains_by_type['sometype'] = (WF_ID_NON % 2,)
00346         self.assertEqual(len(wf_tool.objectIds()), 4)
00347 
00348         context = DummyImportContext(site, False)
00349         context._files['workflows.xml'] = self._FRAGMENT_IMPORT
00350         importWorkflowTool(context)
00351 
00352         self.assertEqual(len(wf_tool.objectIds()), 4)
00353         self.assertEqual(len(wf_tool._default_chain), 1)
00354         self.assertEqual(wf_tool._default_chain[0], WF_ID_NON % 1)
00355         self.assertEqual(len(wf_tool._chains_by_type), 0)
00356 

Here is the call graph for this function:


Member Data Documentation

Definition at line 212 of file test_workflow.py.

Definition at line 213 of file test_workflow.py.

Definition at line 214 of file test_workflow.py.

Definition at line 210 of file test_workflow.py.


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