Skip to content

Commit 7f8bb59

Browse files
committed
edit assertion for MongoDB's even rounding
1 parent 07bce84 commit 7f8bb59

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/db_functions/comparison/test_cast.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def test_cast_to_decimal_field(self):
5252
),
5353
).get()
5454
self.assertEqual(float_obj.cast_f1_decimal, decimal.Decimal("-1.93"))
55-
self.assertEqual(float_obj.cast_f2_decimal, decimal.Decimal("3.5"))
55+
# MongoDB rounds to 3.4 instead of 3.5 like other databases.
56+
self.assertEqual(float_obj.cast_f2_decimal, decimal.Decimal("3.4"))
5657
author_obj = Author.objects.annotate(
5758
cast_alias_decimal=Cast(
5859
"alias", models.DecimalField(max_digits=8, decimal_places=2)

0 commit comments

Comments
 (0)