0001-workflows-fix-display-of-email-action-recipients-wit.patch
tests/test_workflows.py | ||
---|---|---|
3103 | 3103 |
assert display_message.get_line_details() == 'with actions, for foorole' |
3104 | 3104 | |
3105 | 3105 | |
3106 |
def test_workflow_email_line_details(pub): |
|
3107 |
workflow = Workflow(name='email') |
|
3108 |
st1 = workflow.add_status('Status1', 'st1') |
|
3109 |
sendmail = SendmailWorkflowStatusItem() |
|
3110 |
sendmail.parent = st1 |
|
3111 | ||
3112 |
assert sendmail.get_line_details() == 'not completed' |
|
3113 | ||
3114 |
role = pub.role_class(name='foorole') |
|
3115 |
role.store() |
|
3116 |
sendmail.to = [role.id] |
|
3117 |
assert sendmail.get_line_details() == 'to foorole' |
|
3118 | ||
3119 |
sendmail.to = ['test@example.net'] |
|
3120 |
assert sendmail.get_line_details() == 'to test@example.net' |
|
3121 | ||
3122 |
sendmail.to = ['{{ foobar }}'] |
|
3123 |
assert sendmail.get_line_details() == 'to computed value' |
|
3124 | ||
3125 | ||
3106 | 3126 |
def test_workflow_roles(pub, emails): |
3107 | 3127 |
pub.substitutions.feed(MockSubstitutionVariables()) |
3108 | 3128 |
wcs/workflows.py | ||
---|---|---|
2816 | 2816 |
role_label = get_role_translation_label(self.parent.parent, r) |
2817 | 2817 |
if role_label: |
2818 | 2818 |
t.append(role_label) |
2819 |
return ', '.join(t)
|
|
2819 |
return ', '.join([str(x) for x in t])
|
|
2820 | 2820 | |
2821 | 2821 |
def get_to_parameter_view_value(self): |
2822 | 2822 |
return self.render_list_of_roles_or_emails(self.to) |
2823 |
- |