Skip to content

Commit 2a6e6df

Browse files
committed
Use DatabaseFeatures.rounds_to_even (new in Django 5.2)
1 parent 4871c5f commit 2a6e6df

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

django_mongodb_backend/features.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
1212
greatest_least_ignores_nulls = True
1313
has_json_object_function = False
1414
has_native_json_field = True
15+
rounds_to_even = True
1516
supports_boolean_expr_in_select_clause = True
1617
supports_collation_on_charfield = False
1718
supports_column_check_constraints = False
@@ -56,8 +57,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
5657
# Pattern lookups that use regexMatch don't work on JSONField:
5758
# Unsupported conversion from array to string in $convert
5859
"model_fields.test_jsonfield.TestQuerying.test_icontains",
59-
# MongoDB gives ROUND(365, -1)=360 instead of 370 like other databases.
60-
"db_functions.math.test_round.RoundTests.test_integer_with_negative_precision",
6160
# Truncating in another timezone doesn't work becauase MongoDB converts
6261
# the result back to UTC.
6362
"db_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests.test_trunc_func_with_timezone",

0 commit comments

Comments
 (0)