mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 07:39:41 +02:00
* fix(frontend): 🐛 update dialog implementation to simplify state management * test(backend): ✅ refactor test fixtures + admin group tests * chore(backend): 🔨 add launcher.json for python debugging (tests) * fix typing * feat(backend): ✨ refactor/fix group management for admins * feat(frontend): ✨ add/fix admin group management * add LDAP checker Co-authored-by: hay-kot <hay-kot@pm.me>
27 lines
793 B
Python
27 lines
793 B
Python
import json
|
|
|
|
import pytest
|
|
from fastapi.testclient import TestClient
|
|
|
|
from tests.utils.app_routes import AppRoutes
|
|
|
|
|
|
@pytest.fixture
|
|
def backup_data():
|
|
return {
|
|
"name": "test_backup_2021-Apr-27.zip",
|
|
"force": True,
|
|
"recipes": True,
|
|
"settings": False, # ! Broken
|
|
"groups": False, # ! Also Broken
|
|
"users": False,
|
|
}
|
|
|
|
|
|
def test_import(api_client: TestClient, api_routes: AppRoutes, backup_data, admin_token):
|
|
import_route = api_routes.backups_file_name_import("test_backup_2021-Apr-27.zip")
|
|
response = api_client.post(import_route, json=backup_data, headers=admin_token)
|
|
assert response.status_code == 200
|
|
for _, value in json.loads(response.content).items():
|
|
for v in value:
|
|
assert v["status"] is True
|