mealie/tests/integration_tests/test_import_routes.py
Hayden 3c504e7048
feat(backend): migrate site-settings to groups (#673)
* feat(frontend):  add user registration page (WIP)

* feat(backend):  add user registration (WIP)

* test(backend):  add validator testing for registration schema

* feat(backend):  continued work on user sign-up

* feat(backend):  add signup flow and user/group settings

* test(backend):  user-creation tests and small refactor of existing tests

* fix(backend):  fix failing group tests

* style: 🎨 fix lint issues

Co-authored-by: hay-kot <hay-kot@pm.me>
2021-09-05 22:05:29 -08:00

28 lines
786 B
Python

import json
import pytest
from fastapi.testclient import TestClient
from tests.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": True,
}
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