Have sell_type stringify correctly

This commit is contained in:
Matthias 2020-06-27 07:08:16 +02:00
parent 04eaf2c39c
commit 1339479882
2 changed files with 5 additions and 1 deletions

View File

@ -45,6 +45,10 @@ class SellType(Enum):
EMERGENCY_SELL = "emergency_sell"
NONE = ""
def __str__(self):
# explicitly convert to String to help with exporting data.
return self.value
class SellCheckTuple(NamedTuple):
"""

View File

@ -320,7 +320,7 @@ def test_edge_overrides_stoploss(limit_buy_order, fee, caplog, mocker, edge_conf
# stoploss shoud be hit
assert freqtrade.handle_trade(trade) is True
assert log_has('Executing Sell for NEO/BTC. Reason: SellType.STOP_LOSS', caplog)
assert log_has('Executing Sell for NEO/BTC. Reason: stop_loss', caplog)
assert trade.sell_reason == SellType.STOP_LOSS.value