Skip to content

Commit 88d3839

Browse files
authored
Fix lingering todoist test by fixing its test time (#154511)
1 parent 3c001bd commit 88d3839

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/components/todoist/test_calendar.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Unit tests for the Todoist calendar platform."""
22

3-
from datetime import timedelta
3+
from datetime import datetime, timedelta
44
from http import HTTPStatus
55
from typing import Any
66
from unittest.mock import AsyncMock, patch
@@ -141,7 +141,12 @@ async def test_update_entity_for_custom_project_no_due_date_on(
141141
[
142142
Due(
143143
# Note: This runs before the test fixture that sets the timezone
144-
date=(dt_util.now(TIMEZONE) + timedelta(days=3)).strftime("%Y-%m-%d"),
144+
date=(
145+
datetime(
146+
day=15, month=10, year=2025, hour=23, minute=45, tzinfo=TIMEZONE
147+
)
148+
+ timedelta(days=3)
149+
).strftime("%Y-%m-%d"),
145150
is_recurring=False,
146151
string="3 days from today",
147152
)
@@ -158,9 +163,9 @@ async def test_update_entity_for_calendar_with_due_date_in_the_future(
158163
assert state.state == "on"
159164

160165
# The end time should be in the user's timezone
161-
expected_end_time = (dt_util.now() + timedelta(days=3)).strftime(
162-
"%Y-%m-%d 00:00:00"
163-
)
166+
expected_end_time = (
167+
datetime(day=15, month=10, year=2025, hour=23, minute=45) + timedelta(days=3)
168+
).strftime("%Y-%m-%d 00:00:00")
164169
assert state.attributes["end_time"] == expected_end_time
165170

166171

0 commit comments

Comments
 (0)