diff --git a/product/ERP5Type/tests/ERP5TypeTestCase.py b/product/ERP5Type/tests/ERP5TypeTestCase.py index cc3e74dfb1d25fb068d504305cd05cd30cd3276f..b72b1f8da3da8ecdfbcabc2493819a4678df2b03 100644 --- a/product/ERP5Type/tests/ERP5TypeTestCase.py +++ b/product/ERP5Type/tests/ERP5TypeTestCase.py @@ -794,9 +794,7 @@ class ERP5TypeCommandLineTestCase(ERP5TypeTestCaseMixin): light_install = self.enableLightInstall() create_activities = self.enableActivityTool() hot_reindexing = self.enableHotReindexing() - # install business template and its dependencies - for x, y in (("erp5_workflow", "erp5_base"), - ("erp5_core_proxy_field_legacy", "erp5_base"), + for x, y in (("erp5_core_proxy_field_legacy", "erp5_base"), ("erp5_stock_cache", "erp5_pdm")): if x not in template_list: try: diff --git a/product/ERP5Type/tests/testERP5Type.py b/product/ERP5Type/tests/testERP5Type.py index e0ebe65a5cd071959ae8543f4d13fb95b7e5d9d5..7843b1ac5e3bed062cdac6c6386c63cc07b8d0bd 100644 --- a/product/ERP5Type/tests/testERP5Type.py +++ b/product/ERP5Type/tests/testERP5Type.py @@ -29,7 +29,7 @@ import cPickle import unittest import sys -import pdb + import transaction from random import randint from Acquisition import aq_base @@ -975,24 +975,17 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): """Tests for workflow state. assumes that validation state is chained to the Person portal type and that this workflow has 'validation_state' as state_variable. - - zwj: 28-1-2015 add ERP5Workflow compability. """ self.portal.Localizer = DummyLocalizer() message_catalog = self.portal.Localizer.erp5_ui person = self.getPersonModule().newContent(id='1', portal_type='Person') + wf = self.getWorkflowTool().validation_workflow # those are assumptions for this test. - if not person.getTypeInfo().getTypeERP5WorkflowList(): - wf = self.getWorkflowTool().validation_workflow - self.assertTrue(wf.getId() in + self.assertTrue(wf.getId() in self.getWorkflowTool().getChainFor('Person')) - self.assertEqual('validation_state', wf.variables.getStateVar()) - initial_state = wf.states[wf.initial_state] - other_state = wf.states['validated'] - else: - wf = self.getPortalObject().getDefaultModule('Workflow')._getOb('erp5_validation_workflow') - initial_state = wf.getSourceValue() - other_state = wf._getOb('validated') + self.assertEqual('validation_state', wf.variables.getStateVar()) + initial_state = wf.states[wf.initial_state] + other_state = wf.states['validated'] self.assertTrue(hasattr(person, 'getValidationState')) self.assertTrue(hasattr(person, 'getValidationStateTitle')) @@ -1836,16 +1829,13 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): # Create a new temporary person object. from Products.ERP5Type.Document import newTempPerson o = newTempPerson(portal, 'temp_person_1') - #pdb.set_trace() self.assertTrue(o.isTempObject()) self.assertEqual(o.getOriginalDocument(), None) # This should generate a workflow method. - # ERP5 workflow doesn't support this step, pass, - if not o.getTypeInfo().getTypeERP5WorkflowList(): - self.assertEqual(o.getValidationState(), 'draft') - o.validate() - self.assertEqual(o.getValidationState(), 'validated') + self.assertEqual(o.getValidationState(), 'draft') + o.validate() + self.assertEqual(o.getValidationState(), 'validated') # Create a new persistent person object. person_module = portal.person_module @@ -1883,11 +1873,9 @@ class TestERP5Type(PropertySheetTestCase, LogInterceptor): self.assertTrue(o.isTempObject()) # This should call methods generated for the persistent object. - ### zwj: ERP5Workflow doesn't support, pass - if not o.getTypeInfo().getTypeERP5WorkflowList(): - self.assertEqual(o.getValidationState(), 'draft') - o.validate() - self.assertEqual(o.getValidationState(), 'validated') + self.assertEqual(o.getValidationState(), 'draft') + o.validate() + self.assertEqual(o.getValidationState(), 'validated') def test_26_hasAccessors(self): """Test 'has' Accessor.