def test_empty(self): from Products.CMFCore.exportimport.workflow import exportWorkflowTool site, _wtool = self._initSite() context = DummyExportContext(site) exportWorkflowTool(context) self.assertEqual(len(context._wrote), 1) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'workflows.xml') self._compareDOM(text, _EMPTY_TOOL_EXPORT) self.assertEqual(content_type, 'text/xml')
def test_empty(self): from Products.CMFCore.exportimport.workflow import exportWorkflowTool site = self._initSite() context = DummyExportContext(site) exportWorkflowTool(context) self.assertEqual(len(context._wrote), 1) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'workflows.xml') self._compareDOM(text, _EMPTY_TOOL_EXPORT) self.assertEqual(content_type, 'text/xml')
def test_normal(self): from Products.CMFCore.exportimport.workflow import exportWorkflowTool WF_ID_NON = 'non_dcworkflow' WF_TITLE_NON = 'Non-DCWorkflow' site, wf_tool = self._initSite() nondcworkflow = DummyWorkflow(WF_TITLE_NON) nondcworkflow.title = WF_TITLE_NON wf_tool._setObject(WF_ID_NON, nondcworkflow) context = DummyExportContext(site) exportWorkflowTool(context) self.assertEqual(len(context._wrote), 2) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'workflows.xml') self._compareDOM(text, _NORMAL_TOOL_EXPORT) self.assertEqual(content_type, 'text/xml')
def test_normal(self): from Products.CMFCore.exportimport.workflow import exportWorkflowTool WF_ID_NON = 'non_dcworkflow' WF_TITLE_NON = 'Non-DCWorkflow' site = self._initSite() wf_tool = site.portal_workflow nondcworkflow = DummyWorkflow(WF_TITLE_NON) nondcworkflow.title = WF_TITLE_NON wf_tool._setObject(WF_ID_NON, nondcworkflow) context = DummyExportContext(site) exportWorkflowTool(context) self.assertEqual(len(context._wrote), 2) filename, text, content_type = context._wrote[0] self.assertEqual(filename, 'workflows.xml') self._compareDOM(text, _NORMAL_TOOL_EXPORT) self.assertEqual(content_type, 'text/xml')