mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-06 05:55:23 +02:00
Merge branch 'mealie-next' into fix/translation-issues-when-scraping
This commit is contained in:
commit
634b0590ed
183 changed files with 4530 additions and 2172 deletions
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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",
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue