mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-03 02:23:05 +00:00
refactor: tests - update timezone.utc to UTC
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user