Exemplo n.º 1
0
 def setUp(self):
     PriceManagement.save_cache_price = MagicMock(return_value=CryptoPrice(
         CURRENCY.ETH,
         Decimal('100'),
         Decimal('100'),
     ))
     RateManagement.save_rates = MagicMock(return_value=None)
Exemplo n.º 2
0
    def setUp(self):
        PriceManagement.get_cache_price = MagicMock(return_value=CryptoPrice(
            CURRENCY.ETH,
            Decimal('100'),
            Decimal('100'),
        ))
        RateManagement.get_cache_rate = MagicMock(
            return_value=Decimal('23000'))

        FeeFactory(key=FEE_COIN_ORDER_BANK,
                   value=Decimal('1'),
                   fee_type=FEE_TYPE.percentage)
        FeeFactory(key=FEE_COIN_ORDER_COD,
                   value=Decimal('10'),
                   fee_type=FEE_TYPE.percentage)

        PoolFactory(currency=CURRENCY.ETH,
                    direction=DIRECTION.buy,
                    usage=1,
                    limit=2)

        self.auth_utils = AuthenticationUtils(self.client)
        self.user = self.auth_utils.create_exchange_user()
        self.auth_utils.login()

        UserLimitFactory(fiat_currency=self.user.currency,
                         direction=DIRECTION_ALL,
                         usage=0,
                         limit=3000000,
                         user=self.user)
    def setUp(self):
        PriceManagement.get_cache_price = MagicMock(return_value=CryptoPrice(
            CURRENCY.ETH,
            Decimal('100'),
            Decimal('100'),
        ))
        RateManagement.get_cache_rate = MagicMock(return_value=Decimal('23000'))

        FeeFactory(key=FEE_COIN_SELLING_ORDER_BANK, value=Decimal('1'), fee_type=FEE_TYPE.percentage)
        PoolFactory(currency=CURRENCY.ETH, direction=DIRECTION.sell, usage=1, limit=2)

        self.password = '******'
        self.username = '******'
        user = self._create_user(self.username)

        exchange_user = ExchangeUserFactory(user=user, currency=FIAT_CURRENCY.PHP)
        UserLimitFactory(fiat_currency=FIAT_CURRENCY.PHP, direction=DIRECTION_ALL, usage=2300000, limit=3000000,
                         user=exchange_user)
    def setUp(self):
        self.auth_utils = AuthenticationUtils(self.client)

        PriceManagement.get_cache_price = MagicMock(return_value=CryptoPrice(
            CURRENCY.ETH,
            Decimal('100'),
            Decimal('100'),
        ))
        RateManagement.get_cache_rate = MagicMock(return_value=Decimal('23000'))

        FeeFactory(key=FEE_COIN_SELLING_ORDER_BANK, value=Decimal('1'), fee_type=FEE_TYPE.percentage)
        FeeFactory(key=FEE_COIN_SELLING_ORDER_COD, value=Decimal('1'), fee_type=FEE_TYPE.percentage)
        PoolFactory(currency=CURRENCY.ETH, direction=DIRECTION.sell, usage=1, limit=2)

        user = self.auth_utils.create_user()
        exchange_user = ExchangeUserFactory(user=user, currency=FIAT_CURRENCY.PHP)
        UserLimitFactory(fiat_currency=FIAT_CURRENCY.PHP, direction=DIRECTION_ALL, usage=2300000, limit=3000000,
                         user=exchange_user)
    def setUp(self):
        self.buy_rate = self.sell_rate = Decimal('100')
        self.fiat_rate = Decimal('1')
        PriceManagement.get_cache_price = MagicMock(return_value=CryptoPrice(
            CURRENCY.ETH,
            self.buy_rate,
            self.sell_rate,
        ))
        RateManagement.get_cache_rate = MagicMock(return_value=self.fiat_rate)

        FeeFactory(key=FEE_COIN_ORDER_BANK,
                   value=Decimal('0'),
                   fee_type=FEE_TYPE.percentage)
        FeeFactory(key=FEE_COIN_ORDER_COD,
                   value=Decimal('0'),
                   fee_type=FEE_TYPE.percentage)
        FeeFactory(key=FEE_COIN_SELLING_ORDER_BANK,
                   value=Decimal('0'),
                   fee_type=FEE_TYPE.percentage)
        FeeFactory(key=FEE_COIN_SELLING_ORDER_COD,
                   value=Decimal('0'),
                   fee_type=FEE_TYPE.percentage)

        PoolFactory(currency=CURRENCY.ETH,
                    direction=DIRECTION.buy,
                    usage=0,
                    limit=100)
        PoolFactory(currency=CURRENCY.ETH,
                    direction=DIRECTION.sell,
                    usage=0,
                    limit=100)

        self.auth_utils = AuthenticationUtils(self.client)
        self.referral = self.auth_utils.create_exchange_user('referral_user')

        self.user = self.auth_utils.create_exchange_user(None, self.referral)
        self.auth_utils.login()

        UserLimitFactory(fiat_currency=self.user.currency,
                         direction=DIRECTION_ALL,
                         usage=0,
                         limit=5000,
                         user=self.user)