Commit f061bfc6 authored by Eteri's avatar Eteri

erp5_core_test: extend test to cover Workflow Transition Variable

parent b1c983ac
...@@ -146,6 +146,22 @@ class TestERP5Workflow(ERP5TypeTestCase): ...@@ -146,6 +146,22 @@ class TestERP5Workflow(ERP5TypeTestCase):
history = doc.workflow_history['wf'] history = doc.workflow_history['wf']
self.assertEqual(len(history), 2)# create, transition1 self.assertEqual(len(history), 2)# create, transition1
transition_variable = transition1.newContent(
portal_type='Workflow Transition Variable',
causality_value=variable1,
variable_default_expression='string:Set by transition variable',
)
workflow._executeTransition(doc,transition1)
self.assertEqual(
workflow.getCurrentStatusDict(doc)['variable1'],
"Set by transition variable")
# Without an expression, the variable is set to None
transition_variable.setVariableDefaultExpression(None)
workflow._executeTransition(doc,transition1)
self.assertEqual(workflow.getCurrentStatusDict(doc)['variable1'], None)
def test_afterScript(self): def test_afterScript(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment