Skip to content

Commit

Permalink
Floating point comparisons should be almost equal
Browse files Browse the repository at this point in the history
  • Loading branch information
martsberger committed Sep 26, 2023
1 parent 2901b25 commit 54c6324
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_pivot/tests/pivot/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 54c6324

Please sign in to comment.