def test_get_buy_amount(self): session = mommy.make(Session) trader = Trader(session_id=session.id) amount = trader.get_buy_amount(7500) assert amount == 1333333333333
def test_get_buy_min_value(self): session = mommy.make(Session) trader = Trader(session_id=session.id) settings.EXCHANGES['BL3P']['min_buy_value'] = { 'BTCEUR': 10000000, 'LTCEUR': 10000000 } amount = trader.get_buy_amount(100000000) settings.EXCHANGES['BL3P']['max_buy_value'] = { 'BTCEUR': 10000000, 'LTCEUR': 5000000 } assert amount == 100000000