mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
general cleanup
This commit is contained in:
parent
223c198e83
commit
8e0e516108
4 changed files with 29 additions and 8 deletions
|
@ -33,10 +33,10 @@ class ImportJob(BackupOptions):
|
|||
"example": {
|
||||
"name": "my_local_backup.zip",
|
||||
"recipes": True,
|
||||
"force": False,
|
||||
"rebase": False,
|
||||
"themes": False,
|
||||
"settings": False,
|
||||
"settings": True,
|
||||
"themes": True,
|
||||
"groups": True,
|
||||
"users": True,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,13 +4,9 @@ import requests
|
|||
from fastapi.testclient import TestClient
|
||||
from mealie.app import app
|
||||
from mealie.core.config import SQLITE_DIR
|
||||
from mealie.db.database import db
|
||||
from mealie.db.db_setup import generate_session, sql_global_init
|
||||
from mealie.db.init_db import init_db
|
||||
from mealie.routes.deps import get_current_user
|
||||
from mealie.schema.user import UserInDB
|
||||
from pytest import fixture
|
||||
from sqlalchemy.orm.session import Session
|
||||
|
||||
from tests.test_config import TEST_DATA
|
||||
|
||||
|
|
25
tests/test_routes/test_import_routes.py
Normal file
25
tests/test_routes/test_import_routes.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def backup_data():
|
||||
return {
|
||||
"name": "dev_sample_data_2021-Feb-13.zip",
|
||||
"force": False,
|
||||
"recipes": True,
|
||||
"settings": False, #! Broken
|
||||
"themes": True,
|
||||
"groups": True,
|
||||
"users": True,
|
||||
}
|
||||
|
||||
|
||||
def test_import(api_client, backup_data):
|
||||
response = api_client.post("/api/backups/dev_sample_data_2021-Feb-13.zip/import", json=backup_data)
|
||||
|
||||
assert response.status_code == 200
|
||||
for key, value in json.loads(response.content).items():
|
||||
for v in value:
|
||||
assert v["status"] == True
|
Loading…
Add table
Add a link
Reference in a new issue