tests: really run workflow tests when testing create from formdata (#88473)

This commit is contained in:
Valentin Deniaud 2024-03-21 18:39:36 +01:00
parent 1bced18ab0
commit dc3b9213ee
2 changed files with 5 additions and 0 deletions

View File

@ -1114,6 +1114,9 @@ def test_workflow_tests_webservice_status_jump(pub):
def test_workflow_tests_create_from_formdata(pub, http_requests, freezer):
pub.cfg['sms'] = {'sender': 'xxx', 'passerelle_url': 'http://passerelle.invalid/'}
pub.write_cfg()
role = pub.role_class(name='test role')
role.store()
user = create_user(pub, is_admin=True)
@ -1206,6 +1209,7 @@ def test_workflow_tests_create_from_formdata(pub, http_requests, freezer):
assert formdata.status == 'wf-end-status'
testdef = TestDef.create_from_formdata(formdef, formdata, add_workflow_tests=True)
testdef.agent_id = user.id
testdef.run(formdef)
actions = testdef.workflow_tests.actions

View File

@ -140,6 +140,7 @@ class WorkflowTests(XmlStorableObject):
def add_action(self, action_class):
action = action_class(id=self.get_new_action_id())
action.parent = self
self.actions.append(action)
return action