1- import operator
2-
31from django .db .backends .base .features import BaseDatabaseFeatures
42from django .utils .functional import cached_property
53
64
75class DatabaseFeatures (BaseDatabaseFeatures ):
8- minimum_database_version = (5 , 0 )
6+ minimum_database_version = (6 , 0 )
97 allow_sliced_subqueries_with_in = False
108 allows_multiple_constraints_on_same_fields = False
119 can_create_inline_fk = False
@@ -24,10 +22,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
2422 supports_expression_indexes = False
2523 supports_foreign_keys = False
2624 supports_ignore_conflicts = False
27- # Before MongoDB 6.0, $in cannot be used in partialFilterExpression.
28- supports_in_index_operator = property (operator .attrgetter ("is_mongodb_6_0" ))
29- # Before MongoDB 6.0, $or cannot be used in partialFilterExpression.
30- supports_or_index_operator = property (operator .attrgetter ("is_mongodb_6_0" ))
3125 supports_json_field_contains = False
3226 # BSON Date type doesn't support microsecond precision.
3327 supports_microsecond_precision = False
@@ -97,16 +91,11 @@ class DatabaseFeatures(BaseDatabaseFeatures):
9791 "expressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_xor_right_null" ,
9892 "expressions.tests.ExpressionOperatorTests.test_lefthand_transformed_field_bitwise_or" ,
9993 }
100- _django_test_expected_failures_partial_expression_in = {
101- "schema.tests.SchemaTests.test_remove_ignored_unique_constraint_not_create_fk_index" ,
102- }
10394
10495 @cached_property
10596 def django_test_expected_failures (self ):
10697 expected_failures = super ().django_test_expected_failures
10798 expected_failures .update (self ._django_test_expected_failures )
108- if not self .supports_in_index_operator :
109- expected_failures .update (self ._django_test_expected_failures_partial_expression_in )
11099 if not self .is_mongodb_6_3 :
111100 expected_failures .update (self ._django_test_expected_failures_bitwise )
112101 return expected_failures
@@ -601,10 +590,6 @@ def django_test_expected_failures(self):
601590 },
602591 }
603592
604- @cached_property
605- def is_mongodb_6_0 (self ):
606- return self .connection .get_database_version () >= (6 , 0 )
607-
608593 @cached_property
609594 def is_mongodb_6_3 (self ):
610595 return self .connection .get_database_version () >= (6 , 3 )
0 commit comments