0001-workflows-ignore-missing-previous-mark-in-jump-with-.patch
tests/test_workflows.py | ||
---|---|---|
2253 | 2253 |
assert formdata.workflow_data.get('_markers_stack') == [{'status_id': 'st1'}] |
2254 | 2254 | |
2255 | 2255 | |
2256 |
def test_jump_missing_previous_mark(two_pubs): |
|
2257 |
workflow = Workflow(name='jump-mark') |
|
2258 |
st1 = workflow.add_status('Status1', 'st1') |
|
2259 | ||
2260 |
jump = JumpWorkflowStatusItem() |
|
2261 |
jump.id = '_jump' |
|
2262 |
jump.by = ['_submitter', '_receiver'] |
|
2263 |
jump.status = '_previous' |
|
2264 |
jump.timeout = 0.1 |
|
2265 |
st1.items.append(jump) |
|
2266 |
jump.parent = st1 |
|
2267 | ||
2268 |
workflow.store() |
|
2269 | ||
2270 |
formdef = FormDef() |
|
2271 |
formdef.name = 'baz' |
|
2272 |
formdef.fields = [] |
|
2273 |
formdef.workflow_id = workflow.id |
|
2274 |
formdef.store() |
|
2275 | ||
2276 |
formdata = formdef.data_class()() |
|
2277 |
formdata.just_created() |
|
2278 |
formdata.store() |
|
2279 | ||
2280 |
time.sleep(0.3) |
|
2281 |
LoggedError.wipe() |
|
2282 |
_apply_timeouts(two_pubs) |
|
2283 |
assert LoggedError.count() == 1 |
|
2284 | ||
2285 | ||
2256 | 2286 |
def test_sms(pub, sms_mocking): |
2257 | 2287 |
pub.cfg['sms'] = {'mode': 'xxx'} |
2258 | 2288 |
formdef = FormDef() |
wcs/formdata.py | ||
---|---|---|
569 | 569 |
return self.formdef.workflow.get_status(status_id) |
570 | 570 | |
571 | 571 |
def jump_status(self, status_id): |
572 |
import pdb; pdb.set_trace() |
|
572 | 573 |
if status_id == '_previous': |
573 | 574 |
previous_status = self.pop_previous_marked_status() |
574 |
assert previous_status, 'failed to compute previous status' |
|
575 |
if not previous_status: |
|
576 |
from wcs.logged_errors import LoggedError |
|
577 |
summary = _('Failed to compute previous status') |
|
578 |
LoggedError.record(summary, formdata=self) |
|
579 |
return |
|
575 | 580 |
status_id = previous_status.id |
576 | 581 |
status = 'wf-%s' % status_id |
577 | 582 |
if not self.evolution: |
578 |
- |