mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
Refactor/user database models (#775)
* fix build error
* drop frontend.old
* improve auto_init decorator
* purge depreciated site settings
* formatting
* update init function
* fix(backend): 🐛 Fix password reset bug
Co-authored-by: Hayden <hay-kot@pm.me>
This commit is contained in:
parent
40462a95f1
commit
ec3b53cdc3
172 changed files with 430 additions and 12255 deletions
|
@ -1,32 +0,0 @@
|
|||
import json
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from mealie.schema.admin import SiteSettings
|
||||
from tests.app_routes import AppRoutes
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def default_settings():
|
||||
return SiteSettings().dict(by_alias=True)
|
||||
|
||||
|
||||
def test_default_settings(api_client: TestClient, api_routes: AppRoutes, default_settings):
|
||||
response = api_client.get(api_routes.site_settings)
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
assert json.loads(response.content) == default_settings
|
||||
|
||||
|
||||
def test_update_settings(api_client: TestClient, api_routes: AppRoutes, default_settings, admin_token):
|
||||
default_settings["language"] = "fr"
|
||||
default_settings["showRecent"] = False
|
||||
|
||||
response = api_client.put(api_routes.site_settings, json=default_settings, headers=admin_token)
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
response = api_client.get(api_routes.site_settings)
|
||||
assert json.loads(response.content) == default_settings
|
Loading…
Add table
Add a link
Reference in a new issue