Merge pull request 'tolère les logos surnuméraires lors des tests' (#528) from jmplace/ScoDoc-Lille:fix_test_logos into master

Reviewed-on: https://scodoc.org/git/ScoDoc/ScoDoc/pulls/528
This commit is contained in:
Emmanuel Viennet 2022-11-12 12:16:00 +01:00
commit e2a8b551cf

View File

@ -66,9 +66,10 @@ def test_global_logos(api_admin_headers):
response = client.get(API_URL + "/logos", headers=headers) response = client.get(API_URL + "/logos", headers=headers)
assert response.status_code == 200 assert response.status_code == 200
assert response.json is not None assert response.json is not None
assert ( assert "header" in response.json
len(response.json) == 4 assert "footer" in response.json
) # 4 items in fakelogo context: ['header', 'footer', 'logo_B', 'logo_C'] assert "B" in response.json
assert "C" in response.json
def test_local_by_id_logos(api_admin_headers): def test_local_by_id_logos(api_admin_headers):
@ -80,9 +81,8 @@ def test_local_by_id_logos(api_admin_headers):
response = client.get(API_URL + "/departement/id/1/logos", headers=headers) response = client.get(API_URL + "/departement/id/1/logos", headers=headers)
assert response.status_code == 200 assert response.status_code == 200
assert response.json is not None assert response.json is not None
assert ( assert "A" in response.json
len(response.json) == 2 assert "D" in response.json
) # 2 items in dept(1, TAPI) fakelogo context: ['logo_A', 'logo_D']
def test_local_by_name_logos(api_admin_headers): def test_local_by_name_logos(api_admin_headers):
@ -94,9 +94,8 @@ def test_local_by_name_logos(api_admin_headers):
response = client.get(API_URL + "/departement/TAPI/logos", headers=headers) response = client.get(API_URL + "/departement/TAPI/logos", headers=headers)
assert response.status_code == 200 assert response.status_code == 200
assert response.json is not None assert response.json is not None
assert ( assert "A" in response.json
len(response.json) == 2 assert "D" in response.json
) # 2 items in dept(1, TAPI) fakelogo context: ['logo_A', 'logo_D']
def test_local_png_by_id_logo(api_admin_headers): def test_local_png_by_id_logo(api_admin_headers):