0001-do-not-jump-after-edit-if-target-status-is-unknown-2.patch
tests/test_form_pages.py | ||
---|---|---|
1611 | 1611 |
assert 'barXYZ' in resp.body # unchanged value is still there |
1612 | 1612 |
assert formdef.data_class().get(data_id).status == 'wf-%s' % st2.id |
1613 | 1613 | |
1614 |
# jump to a unexistant status == do not jump |
|
1615 |
editable.status = 'deleted_status_id' |
|
1616 |
workflow.store() |
|
1617 |
# go back to st1 |
|
1618 |
formdata = formdef.data_class().get(data_id) |
|
1619 |
formdata.status = 'wf-%s' % st1.id |
|
1620 |
formdata.store() |
|
1621 |
assert formdef.data_class().get(data_id).status == 'wf-%s' % st1.id |
|
1622 |
page = login(get_app(pub), username='foo', password='foo').get('/test/%s/' % data_id) |
|
1623 |
resp = page.forms[0].submit('button_editable') |
|
1624 |
resp = resp.follow() |
|
1625 |
resp.forms[0]['f1'] = 'foo3' |
|
1626 |
resp = resp.forms[0].submit('submit') |
|
1627 |
resp = resp.forms[0].submit('submit') |
|
1628 |
resp = resp.follow() |
|
1629 |
assert formdef.data_class().get(data_id).status == 'wf-%s' % st1.id # stay on st1 |
|
1630 | ||
1614 | 1631 |
def test_form_count_dispatching(pub): |
1615 | 1632 |
user = create_user(pub) |
1616 | 1633 |
wcs/forms/root.py | ||
---|---|---|
1067 | 1067 |
url = None |
1068 | 1068 |
for item in wf_status.items: |
1069 | 1069 |
if item.id == self.edit_action_id and item.status: |
1070 |
self.edited_data.jump_status(item.status) |
|
1071 |
url = self.edited_data.perform_workflow() |
|
1072 |
break |
|
1070 |
wf_status = item.get_target_status(self.edited_data) |
|
1071 |
if wf_status: |
|
1072 |
self.edited_data.jump_status(wf_status[0].id) |
|
1073 |
url = self.edited_data.perform_workflow() |
|
1074 |
break |
|
1073 | 1075 |
return redirect(url or '.') |
1074 | 1076 | |
1075 | 1077 |
def tempfile(self): |
1076 |
- |