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:
Ben Konrath 2012-10-11 13:55:16 +02:00
parent 6300334aca
commit 6f736a6823
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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