tests: add check for display message line details

This commit is contained in:
Frédéric Péters 2018-03-11 12:10:25 +01:00
parent fe8c40f7fd
commit 9c7c8633f2
1 changed files with 19 additions and 0 deletions

View File

@ -2174,6 +2174,25 @@ def test_workflow_display_message_to(pub):
assert 'd1' in formdata.get_workflow_messages()
assert 'd2' in formdata.get_workflow_messages()
def test_workflow_display_message_line_details(pub):
workflow = Workflow(name='display message to')
st1 = workflow.add_status('Status1', 'st1')
display_message = DisplayMessageWorkflowStatusItem()
display_message.parent = st1
assert display_message.get_line_details() == 'top of page'
display_message.position = 'top'
assert display_message.get_line_details() == 'top of page'
display_message.position = 'bottom'
assert display_message.get_line_details() == 'bottom of page'
display_message.position = 'actions'
assert display_message.get_line_details() == 'with actions'
role = Role(name='foorole')
role.store()
display_message.to = [role.id]
assert display_message.get_line_details() == 'with actions, for foorole'
def test_workflow_roles(pub, emails):
pub.substitutions.feed(MockSubstitutionVariables())