0001-modify-tests.patch
tests/test_api.py | ||
---|---|---|
1480 | 1480 |
formdata.just_created() |
1481 | 1481 |
if i%3 == 0: |
1482 | 1482 |
formdata.jump_status('new') |
1483 |
elif i%3 == 1: |
|
1484 |
formdata.jump_status('just_submitted') |
|
1483 | 1485 |
else: |
1484 | 1486 |
formdata.jump_status('finished') |
1485 | 1487 |
if i%7 == 0: |
... | ... | |
1514 | 1516 |
assert 'time' in resp.json[0]['evolution'][0] |
1515 | 1517 |
assert resp.json[0]['evolution'][0]['who']['id'] == local_user.id |
1516 | 1518 | |
1519 |
assert all('status' in x['workflow'] for x in resp.json) |
|
1517 | 1520 |
assert [x for x in resp.json if x['fields']['foobar'] == 'FOO BAR 0'][0]['submission']['backoffice'] is True |
1518 | 1521 |
assert [x for x in resp.json if x['fields']['foobar'] == 'FOO BAR 0'][0]['submission']['channel'] == 'mail' |
1519 | 1522 |
assert [x for x in resp.json if x['fields']['foobar'] == 'FOO BAR 1'][0]['submission']['backoffice'] is False |
... | ... | |
1529 | 1532 | |
1530 | 1533 |
# check filter on status |
1531 | 1534 |
resp = get_app(pub).get(sign_uri('/api/forms/test/list?filter=pending', user=local_user)) |
1532 |
assert len(resp.json) == 10 |
|
1533 |
resp = get_app(pub).get(sign_uri('/api/forms/test/list?filter=done', user=local_user)) |
|
1534 | 1535 |
assert len(resp.json) == 20 |
1536 |
resp = get_app(pub).get(sign_uri('/api/forms/test/list?filter=done', user=local_user)) |
|
1537 |
assert len(resp.json) == 10 |
|
1535 | 1538 |
resp = get_app(pub).get(sign_uri('/api/forms/test/list?filter=all', user=local_user)) |
1536 | 1539 |
assert len(resp.json) == 30 |
1537 | 1540 | |
1538 |
- |