tests: update force_sell test to not use empty amount column

This commit is contained in:
Matthias
2024-09-21 16:53:49 +02:00
parent b084efdd06
commit 004e30d6be

View File

@@ -762,7 +762,7 @@ def test_rpc_force_exit(default_conf, ticker, fee, mocker) -> None:
freqtradebot.enter_positions()
# make an limit-buy open trade
trade = Trade.session.scalars(select(Trade).filter(Trade.id == "3")).first()
filled_amount = trade.amount / 2
filled_amount = trade.amount_requested / 2
# Fetch order - it's open first, and closed after cancel_order is called.
mocker.patch(
f"{EXMS}.fetch_order",
@@ -799,7 +799,7 @@ def test_rpc_force_exit(default_conf, ticker, fee, mocker) -> None:
cancel_order_mock.reset_mock()
trade = Trade.session.scalars(select(Trade).filter(Trade.id == "3")).first()
amount = trade.amount
amount = trade.amount_requested
# make an limit-sell open order trade
mocker.patch(
f"{EXMS}.fetch_order",
@@ -832,7 +832,7 @@ def test_rpc_force_exit(default_conf, ticker, fee, mocker) -> None:
assert cancel_order_mock.call_count == 0
trade = Trade.session.scalars(select(Trade).filter(Trade.id == "4")).first()
amount = trade.amount
amount = trade.amount_requested
# make an limit-buy open trade, if there is no 'filled', don't sell it
mocker.patch(
f"{EXMS}.fetch_order",