mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
feat: Filter Recipes By Household (and a ton of bug fixes) (#4207)
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
parent
2a6922a85c
commit
7c274de778
65 changed files with 896 additions and 590 deletions
|
@ -1,4 +1,5 @@
|
|||
import random
|
||||
from collections.abc import Generator
|
||||
from dataclasses import dataclass
|
||||
from uuid import UUID
|
||||
|
||||
|
@ -35,19 +36,20 @@ class TestCookbook:
|
|||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def cookbooks(unique_user: TestUser) -> list[TestCookbook]:
|
||||
def cookbooks(unique_user: TestUser) -> Generator[list[TestCookbook]]:
|
||||
database = unique_user.repos
|
||||
|
||||
data: list[ReadCookBook] = []
|
||||
yield_data: list[TestCookbook] = []
|
||||
for _ in range(3):
|
||||
cb = database.cookbooks.create(SaveCookBook(**get_page_data(unique_user.group_id, unique_user.household_id)))
|
||||
assert cb.slug
|
||||
data.append(cb)
|
||||
yield_data.append(TestCookbook(id=cb.id, slug=cb.slug, name=cb.name, data=cb.model_dump()))
|
||||
|
||||
yield yield_data
|
||||
|
||||
for cb in yield_data:
|
||||
for cb in data:
|
||||
try:
|
||||
database.cookbooks.delete(cb.id)
|
||||
except Exception:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue