fix: Make Mealie Timezone-Aware (#3847)

Co-authored-by: boc-the-git <3479092+boc-the-git@users.noreply.github.com>
This commit is contained in:
Michael Genson
2024-07-08 16:12:20 -05:00
committed by GitHub
parent 17f9eef551
commit d5f7a883df
69 changed files with 250 additions and 176 deletions

View File

@@ -1,4 +1,4 @@
from datetime import date
from datetime import datetime, timezone
from uuid import uuid4
import pytest
@@ -7,7 +7,7 @@ from mealie.schema.meal_plan.new_meal import CreatePlanEntry
def test_create_plan_with_title():
entry = CreatePlanEntry(date=date.today(), title="Test Title")
entry = CreatePlanEntry(date=datetime.now(timezone.utc).date(), title="Test Title")
assert entry.title == "Test Title"
assert entry.recipe_id is None
@@ -15,7 +15,7 @@ def test_create_plan_with_title():
def test_create_plan_with_slug():
uuid = uuid4()
entry = CreatePlanEntry(date=date.today(), recipe_id=uuid)
entry = CreatePlanEntry(date=datetime.now(timezone.utc).date(), recipe_id=uuid)
assert entry.recipe_id == uuid
assert entry.title == ""
@@ -23,4 +23,4 @@ def test_create_plan_with_slug():
def test_slug_or_title_validation():
with pytest.raises(ValueError):
CreatePlanEntry(date=date.today(), slug="", title="")
CreatePlanEntry(date=datetime.now(timezone.utc).date(), slug="", title="")