Skip to content

Commit 6f9e544

Browse files
committed
tests: utiliser "token" comme nom du cookie pour les tests
1 parent d778898 commit 6f9e544

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

back/config/settings/test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "192.168.0.1", "0.0.0.0"]
3232
AUTH_PASSWORD_VALIDATORS = []
33+
AUTH_COOKIE_NAME = "token"
34+
3335

3436
# Configuration nécessaire pour les tests :
3537
BREVO_ACTIVE = False
File renamed without changes.

back/dora/core/tests/test_utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,19 +226,17 @@ def test_address_to_one_line(address1, address2, postal_code, city, expected):
226226
assert address_to_one_line(address1, address2, postal_code, city) == expected
227227

228228

229-
@override_settings(
230-
FRONTEND_URL="https://subdomain.example.com", AUTH_COOKIE_NAME="token_test"
231-
)
229+
@override_settings(FRONTEND_URL="https://subdomain.example.com")
232230
def test_set_auth_token_cookie():
233231
"""set_auth_token_cookie définit le cookie avec les bons attributs."""
234232
response = HttpResponse()
235233
token_key = "test-token-key-12345"
236234

237235
set_auth_token_cookie(response, token_key)
238236

239-
cookie = response.cookies["token_test"]
237+
cookie = response.cookies["token"]
240238

241239
assert (
242240
cookie.OutputString()
243-
== f"token_test={token_key}; Domain=subdomain.example.com; Path=/; SameSite=Lax; Secure"
241+
== f"token={token_key}; Domain=subdomain.example.com; Path=/; SameSite=Lax; Secure"
244242
)

0 commit comments

Comments
 (0)