diff --git a/freqtrade/main.py b/freqtrade/main.py index 9e621bcbb..1d7f87585 100755 --- a/freqtrade/main.py +++ b/freqtrade/main.py @@ -193,7 +193,7 @@ def execute_sell(trade: Trade, limit: float) -> None: profit_trade = trade.calc_profit(rate=limit) current_rate = exchange.get_ticker(trade.pair, False)['bid'] current_profit = trade.calc_profit_percent(current_rate) - + message = """*{exchange}:* Selling *Current Pair:* [{pair}]({pair_url}) *Limit:* `{limit}` diff --git a/freqtrade/tests/rpc/test_rpc_telegram.py b/freqtrade/tests/rpc/test_rpc_telegram.py index 9c99be342..da616ae65 100644 --- a/freqtrade/tests/rpc/test_rpc_telegram.py +++ b/freqtrade/tests/rpc/test_rpc_telegram.py @@ -107,7 +107,7 @@ def test_status_handle(default_conf, update, ticker, mocker): _status(bot=MagicMock(), update=update) assert msg_mock.call_count == 1 - assert '[BTC_ETH]' in msg_mock.call_args_list[0][0][0] + assert '[BTC/ETH]' in msg_mock.call_args_list[0][0][0] def test_status_table_handle(default_conf, update, ticker, mocker): @@ -239,7 +239,9 @@ def test_forcesell_handle(default_conf, update, ticker, ticker_sell_up, mocker): _forcesell(bot=MagicMock(), update=update) assert rpc_mock.call_count == 2 - assert 'Selling [BTC/ETH]' in rpc_mock.call_args_list[-1][0][0] + assert 'Selling' in rpc_mock.call_args_list[-1][0][0] + assert '[BTC/ETH]' in rpc_mock.call_args_list[-1][0][0] + assert 'Amount' in rpc_mock.call_args_list[-1][0][0] assert '0.00001172' in rpc_mock.call_args_list[-1][0][0] assert 'profit: 6.11%, 0.00006126' in rpc_mock.call_args_list[-1][0][0] assert '0.919 USD' in rpc_mock.call_args_list[-1][0][0] @@ -276,7 +278,9 @@ def test_forcesell_down_handle(default_conf, update, ticker, ticker_sell_down, m _forcesell(bot=MagicMock(), update=update) assert rpc_mock.call_count == 2 - assert 'Selling [BTC/ETH]' in rpc_mock.call_args_list[-1][0][0] + assert 'Selling' in rpc_mock.call_args_list[-1][0][0] + assert '[BTC/ETH]' in rpc_mock.call_args_list[-1][0][0] + assert 'Amount' in rpc_mock.call_args_list[-1][0][0] assert '0.00001044' in rpc_mock.call_args_list[-1][0][0] assert 'loss: -5.48%, -0.00005492' in rpc_mock.call_args_list[-1][0][0] assert '-0.824 USD' in rpc_mock.call_args_list[-1][0][0] diff --git a/freqtrade/tests/test_main.py b/freqtrade/tests/test_main.py index a61342480..b8801df85 100644 --- a/freqtrade/tests/test_main.py +++ b/freqtrade/tests/test_main.py @@ -544,7 +544,10 @@ def test_execute_sell_up(default_conf, ticker, ticker_sell_up, mocker): execute_sell(trade=trade, limit=ticker_sell_up()['bid']) assert rpc_mock.call_count == 2 - assert 'Selling [BTC/ETH]' in rpc_mock.call_args_list[-1][0][0] + assert 'Selling' in rpc_mock.call_args_list[-1][0][0] + assert '[BTC/ETH]' in rpc_mock.call_args_list[-1][0][0] + assert 'Amount' in rpc_mock.call_args_list[-1][0][0] + assert 'Current Profit' in rpc_mock.call_args_list[-1][0][0] assert '0.00001172' in rpc_mock.call_args_list[-1][0][0] assert 'profit: 6.11%, 0.00006126' in rpc_mock.call_args_list[-1][0][0] assert '0.919 USD' in rpc_mock.call_args_list[-1][0][0] @@ -581,7 +584,9 @@ def test_execute_sell_down(default_conf, ticker, ticker_sell_down, mocker): execute_sell(trade=trade, limit=ticker_sell_down()['bid']) assert rpc_mock.call_count == 2 - assert 'Selling [BTC/ETH]' in rpc_mock.call_args_list[-1][0][0] + assert 'Selling' in rpc_mock.call_args_list[-1][0][0] + assert '[BTC/ETH]' in rpc_mock.call_args_list[-1][0][0] + assert 'Amount' in rpc_mock.call_args_list[-1][0][0] assert '0.00001044' in rpc_mock.call_args_list[-1][0][0] assert 'loss: -5.48%, -0.00005492' in rpc_mock.call_args_list[-1][0][0] assert '-0.824 USD' in rpc_mock.call_args_list[-1][0][0] @@ -644,7 +649,9 @@ def test_execute_sell_without_conf_sell_up(default_conf, ticker, ticker_sell_up, execute_sell(trade=trade, limit=ticker_sell_up()['bid']) assert rpc_mock.call_count == 2 - assert 'Selling [BTC/ETH]' in rpc_mock.call_args_list[-1][0][0] + assert 'Selling' in rpc_mock.call_args_list[-1][0][0] + assert '[BTC/ETH]' in rpc_mock.call_args_list[-1][0][0] + assert 'Amount' in rpc_mock.call_args_list[-1][0][0] assert '0.00001172' in rpc_mock.call_args_list[-1][0][0] assert '(profit: 6.11%, 0.00006126)' in rpc_mock.call_args_list[-1][0][0] assert 'USD' not in rpc_mock.call_args_list[-1][0][0]