1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-03 04:25:24 +02:00

Merge branch 'mealie-next' into fix/translation-issues-when-scraping

This commit is contained in:
Michael Genson 2024-02-04 13:20:44 -06:00 committed by GitHub
commit 634b0590ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
183 changed files with 4530 additions and 2172 deletions

View file

@ -10,6 +10,12 @@ backup_version_44e8d670719d_1 = CWD / "backups/backup_version_44e8d670719d_1.zip
backup_version_44e8d670719d_2 = CWD / "backups/backup_version_44e8d670719d_2.zip"
"""44e8d670719d: add extras to shopping lists, list items, and ingredient foods"""
backup_version_44e8d670719d_3 = CWD / "backups/backup_version_44e8d670719d_3.zip"
"""44e8d670719d: add extras to shopping lists, list items, and ingredient foods"""
backup_version_44e8d670719d_4 = CWD / "backups/backup_version_44e8d670719d_4.zip"
"""44e8d670719d: add extras to shopping lists, list items, and ingredient foods"""
backup_version_ba1e4a6cfe99_1 = CWD / "backups/backup_version_ba1e4a6cfe99_1.zip"
"""ba1e4a6cfe99: added plural names and alias tables for foods and units"""

Binary file not shown.

Binary file not shown.

View file

@ -13,20 +13,16 @@ class ABCMultiTenantTestCase(ABC):
self.items: list = []
@abstractmethod
def seed_action(self, group_id: str) -> set[int] | set[str]:
...
def seed_action(self, group_id: str) -> set[int] | set[str]: ...
@abstractmethod
def seed_multi(self, group1_id: str, group2_id: str) -> tuple[set[str], set[str]]:
...
def seed_multi(self, group1_id: str, group2_id: str) -> tuple[set[str], set[str]]: ...
@abstractmethod
def get_all(self, token: str) -> Response:
...
def get_all(self, token: str) -> Response: ...
@abstractmethod
def cleanup(self) -> None:
...
def cleanup(self) -> None: ...
def __enter__(self):
pass

View file

@ -1,7 +1,7 @@
from pytest import MonkeyPatch
from mealie.core.config import get_app_settings
from mealie.core.security.hasher import FakeHasher, PasslibHasher, get_hasher
from mealie.core.security.hasher import BcryptHasher, FakeHasher, get_hasher
def test_get_hasher(monkeypatch: MonkeyPatch):
@ -16,7 +16,7 @@ def test_get_hasher(monkeypatch: MonkeyPatch):
hasher = get_hasher()
assert isinstance(hasher, PasslibHasher)
assert isinstance(hasher, BcryptHasher)
get_app_settings.cache_clear()
get_hasher.cache_clear()

View file

@ -1,8 +1,10 @@
from slugify import slugify
from mealie.repos.repository_factory import AllRepositories
from tests.utils.factories import random_int, random_string
def test_group_resolve_similar_names(database: AllRepositories):
def test_create_group_resolve_similar_names(database: AllRepositories):
base_group_name = random_string()
groups = database.groups.create_many({"name": base_group_name} for _ in range(random_int(3, 10)))
@ -22,3 +24,12 @@ def test_group_get_by_slug_or_id(database: AllRepositories):
for group in groups:
assert database.groups.get_by_slug_or_id(group.id) == group
assert database.groups.get_by_slug_or_id(group.slug) == group
def test_update_group_updates_slug(database: AllRepositories):
group = database.groups.create({"name": random_string()})
assert group.slug == slugify(group.name)
new_name = random_string()
group = database.groups.update(group.id, {"name": new_name})
assert group.slug == slugify(new_name)

View file

@ -73,12 +73,16 @@ def test_database_restore():
[
test_data.backup_version_44e8d670719d_1,
test_data.backup_version_44e8d670719d_2,
test_data.backup_version_44e8d670719d_3,
test_data.backup_version_44e8d670719d_4,
test_data.backup_version_ba1e4a6cfe99_1,
test_data.backup_version_bcfdad6b7355_1,
],
ids=[
"44e8d670719d_1: add extras to shopping lists, list items, and ingredient foods",
"44e8d670719d_2: add extras to shopping lists, list items, and ingredient foods",
"44e8d670719d_3: add extras to shopping lists, list items, and ingredient foods",
"44e8d670719d_4: add extras to shopping lists, list items, and ingredient foods",
"ba1e4a6cfe99_1: added plural names and alias tables for foods and units",
"bcfdad6b7355_1: remove tool name and slug unique contraints",
],

View file

@ -5,8 +5,6 @@ admin_about = "/api/admin/about"
"""`/api/admin/about`"""
admin_about_check = "/api/admin/about/check"
"""`/api/admin/about/check`"""
admin_about_docker_validate = "/api/admin/about/docker/validate"
"""`/api/admin/about/docker/validate`"""
admin_about_statistics = "/api/admin/about/statistics"
"""`/api/admin/about/statistics`"""
admin_analytics = "/api/admin/analytics"