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

feat: sort by labels in shopping list copy if labels toggled (#3226)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Docker Nightly Production / Backend Server Tests (push) Waiting to run
Docker Nightly Production / Frontend and End-to-End Tests (push) Waiting to run
Docker Nightly Production / Build Tagged Release (push) Blocked by required conditions
Docker Nightly Production / Notify Discord (push) Blocked by required conditions

* feat: sort by labels in shopping list copy if labels toggled

* fix: call parent validator in shopping list item out (#3227)

* fix: add a unit test for (#3227)

* fixed messy post_validate logic

* feat: label headings in shopping list copy

* feat: blank line for each group in shopping list copy

---------

Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
Olly Welch 2024-02-28 22:06:04 +00:00 committed by GitHub
parent 2809b87ab0
commit 52de8afe2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 83 additions and 14 deletions

View file

@ -0,0 +1,37 @@
from mealie.schema.group.group_shopping_list import ShoppingListItemOut
def test_shopping_list_ingredient_validation():
db_obj = {
"quantity": 8,
"unit": None,
"food": {
"id": "4cf32eeb-d136-472d-86c7-287b6328d21f",
"name": "bell peppers",
"pluralName": None,
"description": "",
"extras": {},
"labelId": None,
"aliases": [],
"label": None,
"createdAt": "2024-02-26T18:29:46.190754",
"updateAt": "2024-02-26T18:29:46.190758",
},
"note": "",
"isFood": True,
"disableAmount": False,
"shoppingListId": "dc8bce82-2da9-49f0-94e6-6d69d311490e",
"checked": False,
"position": 5,
"foodId": "4cf32eeb-d136-472d-86c7-287b6328d21f",
"labelId": None,
"unitId": None,
"extras": {},
"id": "80f4df25-6139-4d30-be0c-4100f50e5396",
"label": None,
"recipeReferences": [],
"createdAt": "2024-02-27T10:18:19.274677",
"updateAt": "2024-02-27T11:26:32.643392",
}
out = ShoppingListItemOut.model_validate(db_obj)
assert out.display == "8 bell peppers"