1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-05 13:35:23 +02:00

chore: bump aiofiles, dotenv, fastapi, pydantic, uvicorn (#1944)

* update aiofiles and dotenv

* bump fastapi and pydantic

* update testclient

* bump ruff and uvicorn
This commit is contained in:
Hayden 2022-12-30 12:44:54 -08:00 committed by GitHub
parent 28cdd485f3
commit d9c39cc1d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 345 additions and 188 deletions

View file

@ -13,7 +13,7 @@ def test_failed_login(api_client: TestClient):
settings = get_app_settings()
form_data = {"username": settings.DEFAULT_EMAIL, "password": "WRONG_PASSWORD"}
response = api_client.post(api_routes.auth_token, form_data)
response = api_client.post(api_routes.auth_token, data=form_data)
assert response.status_code == 401
@ -22,7 +22,7 @@ def test_superuser_login(api_client: TestClient, admin_token):
settings = get_app_settings()
form_data = {"username": settings.DEFAULT_EMAIL, "password": settings.DEFAULT_PASSWORD}
response = api_client.post(api_routes.auth_token, form_data)
response = api_client.post(api_routes.auth_token, data=form_data)
assert response.status_code == 200
new_token = json.loads(response.text).get("access_token")
@ -48,12 +48,12 @@ def test_user_lockout_after_bad_attemps(api_client: TestClient, unique_user: Tes
for _ in range(settings.SECURITY_MAX_LOGIN_ATTEMPTS):
form_data = {"username": unique_user.email, "password": "bad_password"}
response = api_client.post(api_routes.auth_token, form_data)
response = api_client.post(api_routes.auth_token, data=form_data)
assert response.status_code == 401
valid_data = {"username": unique_user.email, "password": unique_user.password}
response = api_client.post(api_routes.auth_token, valid_data)
response = api_client.post(api_routes.auth_token, data=valid_data)
assert response.status_code == 423
# Cleanup

View file

@ -18,11 +18,11 @@ def test_password_reset(api_client: TestClient, unique_user: TestUser, casing: s
elif casing == "upper":
cased_email = unique_user.email.upper()
else:
for i, l in enumerate(unique_user.email):
for i, letter in enumerate(unique_user.email):
if i % 2 == 0:
cased_email += l.upper()
cased_email += letter.upper()
else:
cased_email += l.lower()
cased_email += letter.lower()
cased_email
with session_context() as session:
@ -45,7 +45,7 @@ def test_password_reset(api_client: TestClient, unique_user: TestUser, casing: s
# Test Login
form_data = {"username": unique_user.email, "password": new_password}
response = api_client.post(api_routes.auth_token, form_data)
response = api_client.post(api_routes.auth_token, data=form_data)
assert response.status_code == 200
# Test Token