997 |
997 |
|
998 |
998 |
resp = app.get('/backoffice/workflows/1/')
|
999 |
999 |
resp = resp.click('baz')
|
1000 |
1000 |
resp = resp.click(href='items/1/', index=0)
|
1001 |
1001 |
assert 'foobar' not in [x[2] for x in resp.form['by$element0'].options]
|
1002 |
1002 |
assert '_receiver' in [x[0] for x in resp.form['by$element0'].options]
|
1003 |
1003 |
|
1004 |
1004 |
|
|
1005 |
def test_workflows_edit_choice_action_line_details(pub):
|
|
1006 |
create_superuser(pub)
|
|
1007 |
create_role()
|
|
1008 |
|
|
1009 |
Workflow.wipe()
|
|
1010 |
wf = Workflow(name='foo')
|
|
1011 |
st1 = wf.add_status('New')
|
|
1012 |
st2 = wf.add_status('Resubmit')
|
|
1013 |
|
|
1014 |
jump = ChoiceWorkflowStatusItem()
|
|
1015 |
jump.id = '1'
|
|
1016 |
jump.parent = st1
|
|
1017 |
st1.items.append(jump)
|
|
1018 |
wf.store()
|
|
1019 |
|
|
1020 |
app = login(get_app(pub))
|
|
1021 |
resp = app.get('/backoffice/workflows/%s/status/%s/' % (wf.id, st1.id))
|
|
1022 |
assert resp.html.find('a', {'href': 'items/1/'}).text == 'Manual Jump (not completed)'
|
|
1023 |
|
|
1024 |
jump.label = 'Resubmit'
|
|
1025 |
wf.store()
|
|
1026 |
resp = app.get('/backoffice/workflows/%s/status/%s/' % (wf.id, st1.id))
|
|
1027 |
assert resp.html.find('a', {'href': 'items/1/'}).text == \
|
|
1028 |
'Manual Jump ("Resubmit", to New)'
|
|
1029 |
|
|
1030 |
jump.status = st2.id
|
|
1031 |
wf.store()
|
|
1032 |
resp = app.get('/backoffice/workflows/%s/status/%s/' % (wf.id, st1.id))
|
|
1033 |
assert resp.html.find('a', {'href': 'items/1/'}).text == \
|
|
1034 |
'Manual Jump ("Resubmit", to Resubmit)'
|
|
1035 |
|
|
1036 |
jump.label = 'Resubmit'
|
|
1037 |
wf.store()
|
|
1038 |
resp = app.get('/backoffice/workflows/%s/status/%s/' % (wf.id, st1.id))
|
|
1039 |
assert resp.html.find('a', {'href': 'items/1/'}).text == \
|
|
1040 |
'Manual Jump ("Resubmit", to Resubmit)'
|
|
1041 |
|
|
1042 |
jump.set_marker_on_status = True
|
|
1043 |
wf.store()
|
|
1044 |
resp = app.get('/backoffice/workflows/%s/status/%s/' % (wf.id, st1.id))
|
|
1045 |
assert resp.html.find('a', {'href': 'items/1/'}).text == \
|
|
1046 |
'Manual Jump ("Resubmit", to Resubmit (and set marker))'
|
|
1047 |
|
|
1048 |
jump.set_marker_on_status = False
|
|
1049 |
jump.by = ['_submitter']
|
|
1050 |
wf.store()
|
|
1051 |
resp = app.get('/backoffice/workflows/%s/status/%s/' % (wf.id, st1.id))
|
|
1052 |
assert resp.html.find('a', {'href': 'items/1/'}).text == \
|
|
1053 |
'Manual Jump ("Resubmit", to Resubmit, by User)'
|
|
1054 |
|
|
1055 |
jump.set_marker_on_status = True
|
|
1056 |
wf.store()
|
|
1057 |
resp = app.get('/backoffice/workflows/%s/status/%s/' % (wf.id, st1.id))
|
|
1058 |
assert resp.html.find('a', {'href': 'items/1/'}).text == \
|
|
1059 |
'Manual Jump ("Resubmit", to Resubmit, by User (and set marker))'
|
|
1060 |
|
|
1061 |
|
1005 |
1062 |
def test_workflows_action_subpath(pub):
|
1006 |
1063 |
create_superuser(pub)
|
1007 |
1064 |
role = create_role()
|
1008 |
1065 |
Workflow.wipe()
|
1009 |
1066 |
workflow = Workflow(name='foo')
|
1010 |
1067 |
baz_status = workflow.add_status(name='baz')
|
1011 |
1068 |
display_message = DisplayMessageWorkflowStatusItem()
|
1012 |
1069 |
display_message.parent = baz_status
|