mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Explicitly use Decimal for creating filter test data.
This fixes a Travis build failures on python 2.6: https://travis-ci.org/#!/tomchristie/django-rest-framework/builds/2746628
This commit is contained in:
parent
6300334aca
commit
6f736a6823
|
@ -1,4 +1,5 @@
|
|||
import datetime
|
||||
from decimal import Decimal
|
||||
from django.test import TestCase
|
||||
from django.test.client import RequestFactory
|
||||
from rest_framework import generics, status
|
||||
|
@ -50,7 +51,7 @@ class IntegrationTestFiltering(TestCase):
|
|||
"""
|
||||
Create 10 FilterableItem instances.
|
||||
"""
|
||||
base_data = ('a', 0.25, datetime.date(2012, 10, 8))
|
||||
base_data = ('a', Decimal('0.25'), datetime.date(2012, 10, 8))
|
||||
for i in range(10):
|
||||
text = chr(i + ord(base_data[0])) * 3 # Produces string 'aaa', 'bbb', etc.
|
||||
decimal = base_data[1] + i
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import datetime
|
||||
from decimal import Decimal
|
||||
from django.core.paginator import Paginator
|
||||
from django.test import TestCase
|
||||
from django.test.client import RequestFactory
|
||||
|
@ -83,7 +84,7 @@ class IntegrationTestPaginationAndFiltering(TestCase):
|
|||
"""
|
||||
Create 50 FilterableItem instances.
|
||||
"""
|
||||
base_data = ('a', 0.25, datetime.date(2012, 10, 8))
|
||||
base_data = ('a', Decimal(0.25), datetime.date(2012, 10, 8))
|
||||
for i in range(26):
|
||||
text = chr(i + ord(base_data[0])) * 3 # Produces string 'aaa', 'bbb', etc.
|
||||
decimal = base_data[1] + i
|
||||
|
|
Loading…
Reference in New Issue
Block a user