From b7f3c35502febb8b58cfef64d3a280bc00a1ac8c Mon Sep 17 00:00:00 2001 From: Bertrand Bordage Date: Wed, 28 Oct 2015 17:45:23 +0100 Subject: [PATCH] Fixes the float test on MySQL. --- cachalot/tests/read.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cachalot/tests/read.py b/cachalot/tests/read.py index 6a2b84c..0c980cf 100644 --- a/cachalot/tests/read.py +++ b/cachalot/tests/read.py @@ -735,7 +735,9 @@ class ParameterTypeTestCase(TransactionTestCase): data2 = list(Test.objects.values_list('a_float', flat=True).filter( a_float__isnull=False).order_by('a_float')) self.assertListEqual(data2, data1) - self.assertListEqual(data2, [0.123456789, 12345.6789]) + self.assertEqual(len(data2), 2) + self.assertAlmostEqual(data2[0], 0.123456789, delta=0.0001) + self.assertAlmostEqual(data2[1], 0.123456789, delta=0.0001) with self.assertNumQueries(1): Test.objects.get(a_float=0.123456789)