fixed test_update_trade_state_sell

This commit is contained in:
Sam Germain 2021-10-03 23:13:34 -06:00
parent 2a2b759419
commit 9046caa27c
2 changed files with 10 additions and 3 deletions

View File

@ -800,8 +800,14 @@ class Exchange:
rate_for_order = self.price_to_precision(pair, rate) if needs_price else None rate_for_order = self.price_to_precision(pair, rate) if needs_price else None
self._lev_prep(pair, leverage) self._lev_prep(pair, leverage)
order = self._api.create_order(pair, ordertype, side, order = self._api.create_order(
amount, rate_for_order, params) pair,
ordertype,
side,
amount,
rate_for_order,
params
)
self._log_exchange_response('create_order', order) self._log_exchange_response('create_order', order)
return order return order

View File

@ -717,7 +717,7 @@ def test_process_informative_pairs_added(default_conf_usdt, ticker_usdt, mocker)
assert ("ETH/USDT", default_conf_usdt["timeframe"]) in refresh_mock.call_args[0][0] assert ("ETH/USDT", default_conf_usdt["timeframe"]) in refresh_mock.call_args[0][0]
@pytest.mark.parametrize("is_short", [True, False]) @pytest.mark.parametrize("is_short", [False, True])
def test_execute_entry(mocker, default_conf_usdt, fee, limit_order, def test_execute_entry(mocker, default_conf_usdt, fee, limit_order,
limit_order_open, is_short) -> None: limit_order_open, is_short) -> None:
@ -1909,6 +1909,7 @@ def test_update_trade_state_sell(
open_date=arrow.utcnow().datetime, open_date=arrow.utcnow().datetime,
open_order_id="123456", open_order_id="123456",
is_open=True, is_open=True,
interest_rate=0.0005,
is_short=is_short is_short=is_short
) )
order = Order.parse_from_ccxt_object(open_order, 'LTC/ETH', (enter_side(is_short))) order = Order.parse_from_ccxt_object(open_order, 'LTC/ETH', (enter_side(is_short)))