1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 07:39:41 +02:00

feat: Add Households to Mealie (#3970)

This commit is contained in:
Michael Genson 2024-08-22 10:14:32 -05:00 committed by GitHub
parent 0c29cef17d
commit eb170cc7e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
315 changed files with 6975 additions and 3577 deletions

View file

@ -3,13 +3,12 @@ from uuid import UUID
from fastapi.testclient import TestClient
from mealie.repos.repository_factory import AllRepositories
from mealie.schema.recipe.recipe import Recipe
from tests.utils import api_routes, random_string
from tests.utils.fixture_schemas import TestUser
@dataclass(slots=True)
@dataclass()
class SimpleCase:
value: str
is_valid: bool
@ -41,8 +40,10 @@ def test_validators_email(api_client: TestClient, unique_user: TestUser):
assert response_data["valid"] == user.is_valid
def test_validators_group_name(api_client: TestClient, unique_user: TestUser, database: AllRepositories):
def test_validators_group_name(api_client: TestClient, unique_user: TestUser):
database = unique_user.repos
group = database.groups.get_one(unique_user.group_id)
assert group
groups = [
SimpleCase(value=group.name, is_valid=False),
@ -65,7 +66,7 @@ class RecipeValidators:
def test_validators_recipe(api_client: TestClient, random_recipe: Recipe):
recipes = [
RecipeValidators(name=random_recipe.name, group=random_recipe.group_id, is_valid=False),
RecipeValidators(name=random_recipe.name or "", group=random_recipe.group_id, is_valid=False),
RecipeValidators(name=random_string(), group=random_recipe.group_id, is_valid=True),
RecipeValidators(name=random_string(), group=random_recipe.group_id, is_valid=True),
]