Skip to content

Commit 12324b1

Browse files
committed
chore: remove unneeded formatted strings in tests
1 parent fd85f9e commit 12324b1

9 files changed

+40
-40
lines changed

backend/tests/api/test_admin_structures.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async def test_jwt_token_verification(
2929
},
3030
"structure_id": str(structure_id_pe_livry),
3131
},
32-
headers={"jwt-token": f"{get_professional_jwt}"},
32+
headers={"jwt-token": get_professional_jwt},
3333
)
3434

3535
json = response.json()
@@ -61,7 +61,7 @@ async def test_insert_admin_structure_with_structure_in_db(
6161
},
6262
"structure_id": str(structure_id_pe_livry),
6363
},
64-
headers={"jwt-token": f"{get_admin_structure_jwt}"},
64+
headers={"jwt-token": get_admin_structure_jwt},
6565
)
6666

6767
assert response.status_code == 200
@@ -116,7 +116,7 @@ async def test_insert_existing_admin_structure_in_structure_in_db(
116116
},
117117
"structure_id": str(structure_id_pe_livry),
118118
},
119-
headers={"jwt-token": f"{get_admin_structure_jwt}"},
119+
headers={"jwt-token": get_admin_structure_jwt},
120120
)
121121

122122
assert response.status_code == 200
@@ -163,7 +163,7 @@ async def test_insert_existing_admin_structure_in_existing_structure(
163163
},
164164
"structure_id": str(structure_id_pe_livry),
165165
},
166-
headers={"jwt-token": f"{get_admin_structure_jwt}"},
166+
headers={"jwt-token": get_admin_structure_jwt},
167167
)
168168

169169
assert response.status_code == 200
@@ -204,7 +204,7 @@ async def test_insert_deleted_admin_structure_in_structure_in_db(
204204
},
205205
"structure_id": str(structure_id_pe_livry),
206206
},
207-
headers={"jwt-token": f"{get_admin_structure_jwt}"},
207+
headers={"jwt-token": get_admin_structure_jwt},
208208
)
209209

210210
assert response.status_code == 200

backend/tests/api/test_csv2json.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ async def test_parse_csv(
77
response = test_client.post(
88
"/v1/convert-file/beneficiaries",
99
files={"upload_file": ("filename", file, "text/csv")},
10-
headers={"jwt-token": f"{get_manager_jwt}"},
10+
headers={"jwt-token": get_manager_jwt},
1111
)
1212

1313
assert response.status_code == 200
@@ -25,7 +25,7 @@ async def test_parse_csv_with_all_date_formats(
2525
response = test_client.post(
2626
"/v1/convert-file/beneficiaries",
2727
files={"upload_file": ("filename", file, "text/csv")},
28-
headers={"jwt-token": f"{get_manager_jwt}"},
28+
headers={"jwt-token": get_manager_jwt},
2929
)
3030

3131
assert response.json()[0]["data"]["Identifiant dans le SI*"] == "1234"
@@ -42,7 +42,7 @@ async def test_parse_csv_errors(
4242
response = test_client.post(
4343
"/v1/convert-file/beneficiaries",
4444
files={"upload_file": ("filename", file, "text/csv")},
45-
headers={"jwt-token": f"{get_manager_jwt}"},
45+
headers={"jwt-token": get_manager_jwt},
4646
)
4747

4848
assert response.json()[0]["errors"][0]["key"] == "Date de naissance*"
@@ -66,7 +66,7 @@ async def test_structure_parse_csv(
6666
response = test_client.post(
6767
"/v1/convert-file/structures",
6868
files={"upload_file": ("filename", file, "text/csv")},
69-
headers={"jwt-token": f"{get_manager_jwt}"},
69+
headers={"jwt-token": get_manager_jwt},
7070
)
7171

7272
assert response.status_code == 200
@@ -81,7 +81,7 @@ async def test_structure_parse_csv_with_error(
8181
response = test_client.post(
8282
"/v1/convert-file/structures",
8383
files={"upload_file": ("filename", file, "text/csv")},
84-
headers={"jwt-token": f"{get_manager_jwt}"},
84+
headers={"jwt-token": get_manager_jwt},
8585
)
8686
data = response.json()
8787

@@ -143,7 +143,7 @@ async def test_structure_parse_csv_with_missing_column_should_not_fail(
143143
response = test_client.post(
144144
"/v1/convert-file/structures",
145145
files={"upload_file": ("filename", file, "text/csv")},
146-
headers={"jwt-token": f"{get_manager_jwt}"},
146+
headers={"jwt-token": get_manager_jwt},
147147
)
148148
data = response.json()
149149

backend/tests/api/test_import_beneficiaries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async def import_beneficiaries(
1919
):
2020
return client.post(
2121
"/v1/beneficiaries/bulk",
22-
headers={"jwt-token": f"{token}"},
22+
headers={"jwt-token": token},
2323
data=json.dumps(
2424
{
2525
"need_orientation": True,
@@ -36,7 +36,7 @@ async def test_import_beneficiaries_must_be_done_by_a_manager(
3636
):
3737
response = test_client.post(
3838
"/v1/beneficiaries/bulk",
39-
headers={"jwt-token": f"{get_professional_jwt}"},
39+
headers={"jwt-token": get_professional_jwt},
4040
data=json.dumps(
4141
{
4242
"beneficiaries": [],

backend/tests/api/test_managers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def test_jwt_token_verification(
2020
response = test_client.post(
2121
ENDPOINT_PATH,
2222
json={"email": sender_email, "firstname": "lionel", "lastname": "Bé"},
23-
headers={"jwt-token": f"{get_admin_structure_jwt}"},
23+
headers={"jwt-token": get_admin_structure_jwt},
2424
)
2525

2626
json = response.json()
@@ -46,7 +46,7 @@ async def test_insert_admin_in_db(
4646
"lastname": "Bé",
4747
"deployment_id": str(deployment_id_cd93),
4848
},
49-
headers={"jwt-token": f"{get_admin_cdb_jwt}"},
49+
headers={"jwt-token": get_admin_cdb_jwt},
5050
)
5151
admins = await get_managers_from_deployment(db_connection, deployment_id_cd93)
5252

backend/tests/api/test_notebooks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async def test_orientation_manager_not_allowed_to_add_notebook_member(
3333
):
3434
response = test_client.post(
3535
f"/v1/notebooks/{str(notebook_sophie_tifour.id)}/members",
36-
headers={"jwt-token": f"{giulia_diaby_jwt}"},
36+
headers={"jwt-token": giulia_diaby_jwt},
3737
)
3838
assert response.status_code == 403
3939
json = response.json()
@@ -53,7 +53,7 @@ async def test_add_notebook_member_as_no_referent(
5353
response = test_client.post(
5454
f"/v1/notebooks/{str(notebook_sophie_tifour.id)}/members",
5555
json={"member_type": "no_referent"},
56-
headers={"jwt-token": f"{get_professional_paul_camara_jwt}"},
56+
headers={"jwt-token": get_professional_paul_camara_jwt},
5757
)
5858
assert response.status_code == 204
5959
members = await get_notebook_members_by_notebook_id(
@@ -83,7 +83,7 @@ async def test_add_notebook_member_as_referent(
8383
response = test_client.post(
8484
f"/v1/notebooks/{str(notebook_sophie_tifour.id)}/members",
8585
json={"member_type": "referent"},
86-
headers={"jwt-token": f"{get_professional_paul_camara_jwt}"},
86+
headers={"jwt-token": get_professional_paul_camara_jwt},
8787
)
8888
assert response.status_code == 204
8989
members = await get_notebook_members_by_notebook_id(

backend/tests/api/test_orientation_requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async def test_deny_orientation_request_email(
2222
json={
2323
"orientation_request_id": str(orientation_request_jennings_dee.id),
2424
},
25-
headers={"jwt-token": f"{giulia_diaby_jwt}"},
25+
headers={"jwt-token": giulia_diaby_jwt},
2626
)
2727
print(response.json())
2828
assert response.status_code == 200

backend/tests/api/test_orientations.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def test_professional_not_allowed_to_change_orientation(
5353
"structure_id": str(professional_pierre_chevalier.structure_id),
5454
"new_referent_account_id": str(professional_pierre_chevalier.account_id),
5555
},
56-
headers={"jwt-token": f"{get_professional_jwt}"},
56+
headers={"jwt-token": get_professional_jwt},
5757
)
5858
assert response.status_code == 403
5959
json = response.json()
@@ -76,7 +76,7 @@ async def test_admin_structure_not_allowed_to_change_orientation(
7676
"structure_id": str(professional_pierre_chevalier.structure_id),
7777
"new_referent_account_id": str(professional_pierre_chevalier.account_id),
7878
},
79-
headers={"jwt-token": f"{get_admin_structure_jwt}"},
79+
headers={"jwt-token": get_admin_structure_jwt},
8080
)
8181
assert response.status_code == 403
8282
json = response.json()
@@ -100,7 +100,7 @@ async def test_change_orientation_while_keeping_same_referent(
100100
"structure_id": str(professional_pierre_chevalier.structure_id),
101101
"new_referent_account_id": str(professional_pierre_chevalier.account_id),
102102
},
103-
headers={"jwt-token": f"{giulia_diaby_jwt}"},
103+
headers={"jwt-token": giulia_diaby_jwt},
104104
)
105105
assert response.status_code == 200
106106
members = await get_notebook_members_by_notebook_id(
@@ -130,7 +130,7 @@ async def test_change_orientation_assign_to_structure_not_referent(
130130
"structure_id": str(professional_paul_camara.structure_id),
131131
"new_referent_account_id": None,
132132
},
133-
headers={"jwt-token": f"{giulia_diaby_jwt}"},
133+
headers={"jwt-token": giulia_diaby_jwt},
134134
)
135135
assert response.status_code == 200
136136
members = await get_notebook_members_by_notebook_id(
@@ -187,7 +187,7 @@ async def test_change_orientation_with_new_referent(
187187
"structure_id": str(professional_paul_camara.structure_id),
188188
"new_referent_account_id": str(professional_paul_camara.account_id),
189189
},
190-
headers={"jwt-token": f"{giulia_diaby_jwt}"},
190+
headers={"jwt-token": giulia_diaby_jwt},
191191
)
192192
assert response.status_code == 200
193193
members = await get_notebook_members_by_notebook_id(
@@ -247,7 +247,7 @@ async def test_change_orientation_with_new_referent_when_beneficiary_has_no_stru
247247
"structure_id": str(professional_paul_camara.structure_id),
248248
"new_referent_account_id": str(professional_paul_camara.account_id),
249249
},
250-
headers={"jwt-token": f"{samy_rouate_jwt}"},
250+
headers={"jwt-token": samy_rouate_jwt},
251251
)
252252
assert response.status_code == 200
253253
members = await get_notebook_members_by_notebook_id(
@@ -292,7 +292,7 @@ async def test_change_orientation_with_orientation_request(
292292
"structure_id": str(professional_pierre_chevalier.structure_id),
293293
"new_referent_account_id": str(professional_pierre_chevalier.account_id),
294294
},
295-
headers={"jwt-token": f"{giulia_diaby_jwt}"},
295+
headers={"jwt-token": giulia_diaby_jwt},
296296
)
297297

298298
orientation_request = await get_orientation_request_by_id(
@@ -327,7 +327,7 @@ async def test_send_email_to_members_with_orientation_request(
327327
"new_referent_account_id": str(professional_paul_camara.account_id),
328328
"orientation_request_id": str(orientation_request_jennings_dee.id),
329329
},
330-
headers={"jwt-token": f"{giulia_diaby_jwt}"},
330+
headers={"jwt-token": giulia_diaby_jwt},
331331
)
332332
assert response.status_code == 200
333333
assert mock_send_email.call_count == 2
@@ -364,7 +364,7 @@ async def test_send_email_to_members_without_orientation_request(
364364
"structure_id": str(professional_paul_camara.structure_id),
365365
"new_referent_account_id": str(professional_paul_camara.account_id),
366366
},
367-
headers={"jwt-token": f"{giulia_diaby_jwt}"},
367+
headers={"jwt-token": giulia_diaby_jwt},
368368
)
369369
assert response.status_code == 200
370370
assert mock_send_email.call_count == 2
@@ -400,7 +400,7 @@ async def test_send_email_to_members_first_orientation(
400400
"structure_id": str(professional_paul_camara.structure_id),
401401
"new_referent_account_id": str(professional_paul_camara.account_id),
402402
},
403-
headers={"jwt-token": f"{giulia_diaby_jwt}"},
403+
headers={"jwt-token": giulia_diaby_jwt},
404404
)
405405
assert response.status_code == 200
406406
assert mock_send_email.call_count == 1
@@ -428,7 +428,7 @@ async def test_unconsistent_orientation_request(
428428
"structure_id": str(professional_paul_camara.structure_id),
429429
"orientation_request_id": str(orientation_request_jennings_dee.id),
430430
},
431-
headers={"jwt-token": f"{giulia_diaby_jwt}"},
431+
headers={"jwt-token": giulia_diaby_jwt},
432432
)
433433

434434
assert response.status_code == 400

backend/tests/api/test_structures.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async def test_structure_import_json(
2121
response = test_client.post(
2222
ENDPOINT_PATH,
2323
json={"structures": import_structures_json, "sendAccountEmail": True},
24-
headers={"jwt-token": f"{get_manager_jwt}"},
24+
headers={"jwt-token": get_manager_jwt},
2525
)
2626

2727
data = response.json()
@@ -59,7 +59,7 @@ async def test_structure_with_buggy_import_json(
5959
response = test_client.post(
6060
ENDPOINT_PATH,
6161
json={"structures": import_structures_json_with_errors},
62-
headers={"jwt-token": f"{get_manager_jwt}"},
62+
headers={"jwt-token": get_manager_jwt},
6363
)
6464

6565
data = response.json()
@@ -77,7 +77,7 @@ async def test_structure_with_fail_structure_insert(
7777
response = test_client.post(
7878
ENDPOINT_PATH,
7979
json={"structures": import_structures_json},
80-
headers={"jwt-token": f"{get_manager_jwt}"},
80+
headers={"jwt-token": get_manager_jwt},
8181
)
8282

8383
data = response.json()
@@ -107,7 +107,7 @@ async def test_structure_with_fail_admin_insert(
107107
response = test_client.post(
108108
ENDPOINT_PATH,
109109
json={"structures": import_structures_json},
110-
headers={"jwt-token": f"{get_manager_jwt}"},
110+
headers={"jwt-token": get_manager_jwt},
111111
)
112112

113113
data = response.json()
@@ -139,7 +139,7 @@ async def test_structure_with_fail_admin_structure_structure_insert(
139139
response = test_client.post(
140140
ENDPOINT_PATH,
141141
json={"structures": import_structures_json},
142-
headers={"jwt-token": f"{get_manager_jwt}"},
142+
headers={"jwt-token": get_manager_jwt},
143143
)
144144

145145
data = response.json()

backend/tests/api/test_uploads.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def test_jwt_token_verification(
2020
response = test_client.post(
2121
ENDPOINT_PATH,
2222
files={"upload_file": ("filename", f, "text/plain")},
23-
headers={"jwt-token": f"{get_admin_structure_jwt}"},
23+
headers={"jwt-token": get_admin_structure_jwt},
2424
)
2525

2626
json = response.json()
@@ -42,7 +42,7 @@ async def test_insert_in_db(
4242
test_client.post(
4343
ENDPOINT_PATH,
4444
files={"upload_file": ("filename", f, "text/plain")},
45-
headers={"jwt-token": f"{get_manager_jwt}"},
45+
headers={"jwt-token": get_manager_jwt},
4646
)
4747
orientation_managers = await get_orientation_managers(db_connection)
4848
assert len(orientation_managers) == 5
@@ -76,7 +76,7 @@ async def test_validation_error(
7676
response = test_client.post(
7777
ENDPOINT_PATH,
7878
files={"upload_file": ("filename", f, "text/plain")},
79-
headers={"jwt-token": f"{get_manager_jwt}"},
79+
headers={"jwt-token": get_manager_jwt},
8080
)
8181
json = response.json()
8282

@@ -99,7 +99,7 @@ async def test_handle_xls(
9999
response = test_client.post(
100100
ENDPOINT_PATH,
101101
files={"upload_file": ("filename", f, "application/vnd.ms-excel")},
102-
headers={"jwt-token": f"{get_manager_jwt}"},
102+
headers={"jwt-token": get_manager_jwt},
103103
)
104104
assert response.status_code == 200
105105
json = response.json()
@@ -125,7 +125,7 @@ async def test_handle_xlsx(
125125
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
126126
)
127127
},
128-
headers={"jwt-token": f"{get_manager_jwt}"},
128+
headers={"jwt-token": get_manager_jwt},
129129
)
130130
assert response.status_code == 200
131131
json = response.json()

0 commit comments

Comments
 (0)