예제 #1
0
    def test_decimal_field_frontier_value(self):
        market = MarketFactory()
        market.funding = 2**256
        market.save()

        market_response_data = self.client.get(reverse('api:markets'),
                                               content_type='application/json')
        self.assertEqual(market_response_data.status_code, status.HTTP_200_OK)
        self.assertEqual(len(market_response_data.json().get('results')), 1)

        self.assertEqual(str(market.funding),
                         market_response_data.json()['results'][0]['funding'])
예제 #2
0
    def test_market_trading_volume(self):

        # create markets
        market = MarketFactory()

        market_response_data = self.client.get(reverse('api:markets'),
                                               content_type='application/json')
        self.assertEqual(market_response_data.status_code, status.HTTP_200_OK)
        self.assertEqual(len(market_response_data.json().get('results')), 1)

        self.assertEqual(
            market_response_data.json()['results'][0]['tradingVolume'], "0")

        market.trading_volume = 12
        market.save()

        market_response_data2 = self.client.get(
            reverse('api:markets'), content_type='application/json')
        self.assertEqual(market_response_data2.status_code, status.HTTP_200_OK)
        self.assertEqual(len(market_response_data2.json().get('results')), 1)

        self.assertEqual(
            market_response_data2.json()['results'][0]['tradingVolume'], "12")