refactor: tests - update timezone.utc to UTC

This commit is contained in:
Matthias
2025-07-04 09:02:34 +02:00
parent deb8bde078
commit 640cab2ca8
12 changed files with 81 additions and 81 deletions

View File

@@ -1,5 +1,5 @@
from copy import deepcopy
from datetime import datetime, timedelta, timezone
from datetime import UTC, datetime, timedelta
from unittest.mock import ANY, MagicMock, PropertyMock
import pytest
@@ -347,7 +347,7 @@ def test__rpc_timeunit_profit(
assert day["starting_balance"] in (pytest.approx(1062.37), pytest.approx(1066.46))
assert day["fiat_value"] in (0.0,)
# ensure first day is current date
assert str(days["data"][0]["date"]) == str(datetime.now(timezone.utc).date())
assert str(days["data"][0]["date"]) == str(datetime.now(UTC).date())
# Try invalid data
with pytest.raises(RPCException, match=r".*must be an integer greater than 0*"):
@@ -1296,9 +1296,9 @@ def test_rpc_add_and_delete_lock(mocker, default_conf):
rpc = RPC(freqtradebot)
pair = "ETH/BTC"
rpc._rpc_add_lock(pair, datetime.now(timezone.utc) + timedelta(minutes=4), "", "*")
rpc._rpc_add_lock(pair, datetime.now(timezone.utc) + timedelta(minutes=5), "", "*")
rpc._rpc_add_lock(pair, datetime.now(timezone.utc) + timedelta(minutes=10), "", "*")
rpc._rpc_add_lock(pair, datetime.now(UTC) + timedelta(minutes=4), "", "*")
rpc._rpc_add_lock(pair, datetime.now(UTC) + timedelta(minutes=5), "", "*")
rpc._rpc_add_lock(pair, datetime.now(UTC) + timedelta(minutes=10), "", "*")
locks = rpc._rpc_locks()
assert locks["lock_count"] == 3