Révision 83c9a56a
Ajouté par Frédéric Péters il y a presque 4 ans
tests/test_api.py | ||
---|---|---|
27 | 27 |
def test_signed_api_get(client_service, url_signed): |
28 | 28 |
response = client_service.get(url_signed.url) |
29 | 29 |
if url_signed.orig == 'testserver': |
30 |
status_code = 200
|
|
30 |
status_codes = (200,)
|
|
31 | 31 |
else: |
32 |
status_code = 403
|
|
32 |
status_codes = (401, 403)
|
|
33 | 33 |
|
34 |
assert response.status_code == status_code
|
|
34 |
assert response.status_code in status_codes
|
|
35 | 35 |
|
36 |
if status_code == 200: |
|
36 |
if response.status_code == 200:
|
|
37 | 37 |
assert {'login': '', 'password': ''} == response.data |
38 | 38 |
|
39 | 39 |
|
Formats disponibles : Unified diff
adapt bits for py3 (#19613)