Projet

Général

Profil

0001-modify-tests.patch

Benjamin Dauvergne, 09 janvier 2019 15:41

Télécharger (1,9 ko)

Voir les différences:

Subject: [PATCH 1/2] modify tests

 tests/test_api.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tests/test_api.py
1476 1476
        formdata.just_created()
1477 1477
        if i%3 == 0:
1478 1478
            formdata.jump_status('new')
1479
        elif i%3 == 1:
1480
            formdata.jump_status('just_submitted')
1479 1481
        else:
1480 1482
            formdata.jump_status('finished')
1481 1483
        if i%7 == 0:
......
1510 1512
    assert 'time' in resp.json[0]['evolution'][0]
1511 1513
    assert resp.json[0]['evolution'][0]['who']['id'] == local_user.id
1512 1514

  
1515
    assert all('status' in x['workflow'] for x in resp.json)
1513 1516
    assert [x for x in resp.json if x['fields']['foobar'] == 'FOO BAR 0'][0]['submission']['backoffice'] is True
1514 1517
    assert [x for x in resp.json if x['fields']['foobar'] == 'FOO BAR 0'][0]['submission']['channel'] == 'mail'
1515 1518
    assert [x for x in resp.json if x['fields']['foobar'] == 'FOO BAR 1'][0]['submission']['backoffice'] is False
......
1525 1528

  
1526 1529
    # check filter on status
1527 1530
    resp = get_app(pub).get(sign_uri('/api/forms/test/list?filter=pending', user=local_user))
1528
    assert len(resp.json) == 10
1529
    resp = get_app(pub).get(sign_uri('/api/forms/test/list?filter=done', user=local_user))
1530 1531
    assert len(resp.json) == 20
1532
    resp = get_app(pub).get(sign_uri('/api/forms/test/list?filter=done', user=local_user))
1533
    assert len(resp.json) == 10
1531 1534
    resp = get_app(pub).get(sign_uri('/api/forms/test/list?filter=all', user=local_user))
1532 1535
    assert len(resp.json) == 30
1533 1536

  
1534
-