mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-05-24 01:12:54 -04:00
* feat(frontend): 💄 add recipe title * fix(frontend): 🐛 fixes #722 side-bar issue * feat(frontend): ✨ Add page titles to all pages * minor cleanup * refactor(backend): ♻️ rewrite scheduler to be more modulare and work * feat(frontend): ✨ start password reset functionality * refactor(backend): ♻️ refactor application settings to facilitate dependency injection * refactor(backend): 🔥 remove RECIPE_SETTINGS env variables in favor of group settings * formatting * refactor(backend): ♻️ align naming convention * feat(backend): ✨ password reset * test(backend): ✅ password reset * feat(frontend): ✨ self-service password reset * purge password schedule * update user creation for tests Co-authored-by: Hayden <hay-kot@pm.me>
31 lines
936 B
Python
31 lines
936 B
Python
from pathlib import Path
|
|
|
|
from fastapi.testclient import TestClient
|
|
|
|
from mealie.core.config import get_app_dirs
|
|
|
|
app_dirs = get_app_dirs()
|
|
from tests.app_routes import AppRoutes
|
|
|
|
|
|
def test_update_user_image(
|
|
api_client: TestClient, api_routes: AppRoutes, test_image_jpg: Path, test_image_png: Path, admin_token
|
|
):
|
|
response = api_client.post(
|
|
api_routes.users_id_image(2), files={"profile_image": test_image_jpg.open("rb")}, headers=admin_token
|
|
)
|
|
|
|
assert response.status_code == 200
|
|
|
|
response = api_client.post(
|
|
api_routes.users_id_image(2), files={"profile_image": test_image_png.open("rb")}, headers=admin_token
|
|
)
|
|
|
|
assert response.status_code == 200
|
|
|
|
directory = app_dirs.USER_DIR.joinpath("2")
|
|
assert directory.joinpath("profile_image.png").is_file()
|
|
|
|
# Old profile images are removed
|
|
assert 1 == len([file for file in directory.glob("profile_image.*") if file.is_file()])
|