def test_get_context_wf(self): from arche.models.workflow import get_context_wf dummy = _mk_dummy() #self.assertEqual(get_context_wf(dummy), None) self.config.set_content_workflow('Dummy', 'simple_workflow') wf_obj = get_context_wf(dummy) self.assertTrue(IWorkflow.providedBy(wf_obj))
def test_get_context_wf(self): from arche.workflow import get_context_wf dummy = _mk_dummy() #self.assertEqual(get_context_wf(dummy), None) self.config.set_content_workflow('Dummy', 'simple_workflow') wf_obj = get_context_wf(dummy) self.assertTrue(IWorkflow.providedBy(wf_obj))
def add_workflow(config, workflow): """ Add a workflow object so it will be usable by Arche or subcomponents. """ assert IWorkflow.implementedBy(workflow), "Workflows must always implement IWorkflow" config.registry.registerAdapter(workflow, name = workflow.name) wfs = config.registry._workflows wfs[workflow.name] = workflow workflow.init_acl(config.registry)