mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-24 07:15:24 -07:00
fix failing tests
This commit is contained in:
parent
ca9e4f0804
commit
28e2ae64ea
3 changed files with 6 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -9,7 +9,6 @@ mealie/temp/*
|
||||||
mealie/temp/api.html
|
mealie/temp/api.html
|
||||||
.temp/
|
.temp/
|
||||||
.secret
|
.secret
|
||||||
*.zip
|
|
||||||
|
|
||||||
dev/data/backups/*
|
dev/data/backups/*
|
||||||
dev/data/debug/*
|
dev/data/debug/*
|
||||||
|
|
|
@ -8,18 +8,19 @@ from tests.app_routes import AppRoutes
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def backup_data():
|
def backup_data():
|
||||||
return {
|
return {
|
||||||
"name": "dev_sample_data_2021-Feb-13.zip",
|
"name": "test_backup_2021-Apr-27.zip",
|
||||||
"force": False,
|
"force": True,
|
||||||
"recipes": True,
|
"recipes": True,
|
||||||
"settings": False, # ! Broken
|
"settings": False, # ! Broken
|
||||||
"themes": True,
|
"themes": True,
|
||||||
"groups": True,
|
"groups": True,
|
||||||
"users": True,
|
"users": True,
|
||||||
|
"pages": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def test_import(api_client: TestClient, api_routes: AppRoutes, backup_data, token):
|
def test_import(api_client: TestClient, api_routes: AppRoutes, backup_data, token):
|
||||||
import_route = api_routes.backups_file_name_import("dev_sample_data_2021-Feb-13.zip")
|
import_route = api_routes.backups_file_name_import("test_backup_2021-Apr-27.zip")
|
||||||
response = api_client.post(import_route, json=backup_data, headers=token)
|
response = api_client.post(import_route, json=backup_data, headers=token)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
for _, value in json.loads(response.content).items():
|
for _, value in json.loads(response.content).items():
|
||||||
|
|
|
@ -60,7 +60,7 @@ def test_read_update(api_client: TestClient, api_routes: AppRoutes, recipe_data,
|
||||||
response = api_client.put(recipe_url, json=recipe, headers=token)
|
response = api_client.put(recipe_url, json=recipe, headers=token)
|
||||||
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert json.loads(response.text) == recipe_data.expected_slug
|
assert json.loads(response.text).get("slug") == recipe_data.expected_slug
|
||||||
|
|
||||||
response = api_client.get(recipe_url)
|
response = api_client.get(recipe_url)
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ def test_rename(api_client: TestClient, api_routes: AppRoutes, recipe_data, toke
|
||||||
response = api_client.put(recipe_url, json=recipe, headers=token)
|
response = api_client.put(recipe_url, json=recipe, headers=token)
|
||||||
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert json.loads(response.text) == new_slug
|
assert json.loads(response.text).get("slug") == new_slug
|
||||||
|
|
||||||
recipe_data.expected_slug = new_slug
|
recipe_data.expected_slug = new_slug
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue