diff --git a/tests/test_workflows.py b/tests/test_workflows.py index 400b2366f..ecc3401c5 100644 --- a/tests/test_workflows.py +++ b/tests/test_workflows.py @@ -3103,6 +3103,26 @@ def test_workflow_display_message_line_details(pub): assert display_message.get_line_details() == 'with actions, for foorole' +def test_workflow_email_line_details(pub): + workflow = Workflow(name='email') + st1 = workflow.add_status('Status1', 'st1') + sendmail = SendmailWorkflowStatusItem() + sendmail.parent = st1 + + assert sendmail.get_line_details() == 'not completed' + + role = pub.role_class(name='foorole') + role.store() + sendmail.to = [role.id] + assert sendmail.get_line_details() == 'to foorole' + + sendmail.to = ['test@example.net'] + assert sendmail.get_line_details() == 'to test@example.net' + + sendmail.to = ['{{ foobar }}'] + assert sendmail.get_line_details() == 'to computed value' + + def test_workflow_roles(pub, emails): pub.substitutions.feed(MockSubstitutionVariables()) diff --git a/wcs/workflows.py b/wcs/workflows.py index 33c4cb34d..b89a0e73f 100644 --- a/wcs/workflows.py +++ b/wcs/workflows.py @@ -2816,7 +2816,7 @@ class SendmailWorkflowStatusItem(WorkflowStatusItem): role_label = get_role_translation_label(self.parent.parent, r) if role_label: t.append(role_label) - return ', '.join(t) + return ', '.join([str(x) for x in t]) def get_to_parameter_view_value(self): return self.render_list_of_roles_or_emails(self.to)