workflow_test: make sure body is optional when testing SMS (#88473)
This commit is contained in:
parent
4d5b309986
commit
1bced18ab0
|
@ -636,6 +636,12 @@ def test_workflow_tests_sms(pub):
|
|||
|
||||
testdef = TestDef.create_from_formdata(formdef, formdata)
|
||||
testdef.agent_id = user.id
|
||||
testdef.workflow_tests.actions = [
|
||||
workflow_tests.AssertSMS(),
|
||||
]
|
||||
|
||||
testdef.run(formdef)
|
||||
|
||||
testdef.workflow_tests.actions = [
|
||||
workflow_tests.AssertSMS(phone_numbers=['0123456789'], body='Hello'),
|
||||
]
|
||||
|
|
|
@ -771,7 +771,7 @@ class AssertSMS(WorkflowTestAction):
|
|||
details = [_('SMS phone numbers: %s') % ', '.join(sms['phone_numbers'])]
|
||||
raise WorkflowTestError(_('SMS was not sent to %s.') % recipient, details=details)
|
||||
|
||||
if self.body != sms['body']:
|
||||
if self.body and self.body != sms['body']:
|
||||
details = [_('SMS body: "%s"') % sms['body']]
|
||||
raise WorkflowTestError(_('SMS body mismatch.'), details=details)
|
||||
|
||||
|
|
Loading…
Reference in New Issue