add missing datetime conversion in fromJson
This commit is contained in:
parent
212b511bbe
commit
d1591883a6
@ -1593,7 +1593,7 @@ class Trade(_DECL_BASE, LocalTrade):
|
||||
average=order["average"],
|
||||
cost=order["cost"],
|
||||
filled=order["filled"],
|
||||
order_date=order["order_date"],
|
||||
order_date=datetime.strptime(order["order_date"], DATETIME_PRINT_FORMAT),
|
||||
order_filled_date=(datetime.fromtimestamp(
|
||||
order["order_filled_timestamp"] // 1000, tz=timezone.utc)
|
||||
if order["order_filled_timestamp"] else None),
|
||||
|
@ -178,3 +178,4 @@ def test_trade_fromjson():
|
||||
assert len(trade.orders) == 5
|
||||
last_o = trade.orders[-1]
|
||||
assert last_o.order_filled_date == datetime(2022, 10, 18, 9, 45, 22, tzinfo=timezone.utc)
|
||||
assert isinstance(last_o.order_date, datetime)
|
||||
|
Loading…
Reference in New Issue
Block a user