def recalculate_size(self): price = self.get_trade_price() if price == 0: return total = self.get_trade_total() size = money.divide(total, price) self.set_trade_size(size)
def test_divide(self): self.assertEqual(200000000, money.divide(1000000000, 500000000))