From 52bceffce951bce35471e06b86ff6aea6da74a0e Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Tue, 17 Dec 2024 20:49:45 -0500 Subject: [PATCH] use DatabaseFeatures.rounds_to_even --- django_mongodb/features.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/django_mongodb/features.py b/django_mongodb/features.py index cc88fd6d..4b058c69 100644 --- a/django_mongodb/features.py +++ b/django_mongodb/features.py @@ -14,6 +14,7 @@ class DatabaseFeatures(BaseDatabaseFeatures): greatest_least_ignores_nulls = True has_json_object_function = False has_native_json_field = True + rounds_to_even = True supports_boolean_expr_in_select_clause = True supports_collation_on_charfield = False supports_column_check_constraints = False @@ -62,8 +63,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): # Pattern lookups that use regexMatch don't work on JSONField: # Unsupported conversion from array to string in $convert "model_fields.test_jsonfield.TestQuerying.test_icontains", - # MongoDB gives ROUND(365, -1)=360 instead of 370 like other databases. - "db_functions.math.test_round.RoundTests.test_integer_with_negative_precision", # Truncating in another timezone doesn't work becauase MongoDB converts # the result back to UTC. "db_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests.test_trunc_func_with_timezone",