From 54c6324f3f8817fc9f420ad64b34539dd2593fd0 Mon Sep 17 00:00:00 2001 From: martsberger Date: Tue, 26 Sep 2023 09:11:56 -0400 Subject: [PATCH] Floating point comparisons should be almost equal --- django_pivot/tests/pivot/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_pivot/tests/pivot/test.py b/django_pivot/tests/pivot/test.py index e476064..74f951d 100644 --- a/django_pivot/tests/pivot/test.py +++ b/django_pivot/tests/pivot/test.py @@ -132,7 +132,7 @@ def test_total_column_avg(self): for row in pt: style = row['style'] - self.assertEqual(row['Total'], mean(ss.units for ss in shirt_sales if ss.style == style)) + self.assertAlmostEqual(row['Total'], mean(ss.units for ss in shirt_sales if ss.style == style), places=4) def test_pivot_on_choice_field_row(self): shirt_sales = ShirtSales.objects.all()