@@ -12,6 +12,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
12
12
supports_json_field_contains = False
13
13
# BSON Date type doesn't support microsecond precision.
14
14
supports_microsecond_precision = False
15
+ supports_temporal_subtraction = True
15
16
# MongoDB stores datetimes in UTC.
16
17
supports_timezones = False
17
18
# Not implemented: https://github.com/mongodb-labs/django-mongodb/issues/7
@@ -32,6 +33,8 @@ class DatabaseFeatures(BaseDatabaseFeatures):
32
33
"db_functions.tests.FunctionTests.test_nested_function_ordering" ,
33
34
"db_functions.text.test_length.LengthTests.test_ordering" ,
34
35
"db_functions.text.test_strindex.StrIndexTests.test_order_by" ,
36
+ "expressions.tests.BasicExpressionsTests.test_order_by_exists" ,
37
+ "expressions.tests.BasicExpressionsTests.test_order_by_multiline_sql" ,
35
38
"expressions_case.tests.CaseExpressionTests.test_order_by_conditional_explicit" ,
36
39
"lookup.tests.LookupQueryingTests.test_lookup_in_order_by" ,
37
40
"ordering.tests.OrderingTests.test_default_ordering" ,
@@ -86,11 +89,33 @@ class DatabaseFeatures(BaseDatabaseFeatures):
86
89
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_reverse_m2m" ,
87
90
"annotations.tests.NonAggregateAnnotationTestCase.test_chaining_annotation_filter_with_m2m" ,
88
91
"lookup.tests.LookupTests.test_lookup_collision" ,
92
+ "expressions.test_queryset_values.ValuesExpressionsTests.test_values_list_expression" ,
93
+ "expressions.test_queryset_values.ValuesExpressionsTests.test_values_list_expression_flat" ,
89
94
"expressions_case.tests.CaseExpressionTests.test_join_promotion" ,
90
95
"expressions_case.tests.CaseExpressionTests.test_join_promotion_multiple_annotations" ,
91
96
"ordering.tests.OrderingTests.test_order_by_grandparent_fk_with_expression_in_default_ordering" ,
92
97
"ordering.tests.OrderingTests.test_order_by_parent_fk_with_expression_in_default_ordering" ,
93
98
"ordering.tests.OrderingTests.test_order_by_ptr_field_with_default_ordering_by_expression" ,
99
+ # 'Col' object has no attribute 'utcoffset'
100
+ "expressions.tests.IterableLookupInnerExpressionsTests.test_expressions_in_lookups_join_choice" ,
101
+ "expressions.tests.IterableLookupInnerExpressionsTests.test_in_lookup_allows_F_expressions_and_expressions_for_datetimes" ,
102
+ # DatabaseOperations.convert_decimalfield_value() crash:
103
+ # 'int' object has no attribute 'to_decimal'.
104
+ "expressions.tests.ExpressionsNumericTests.test_filter_decimal_expression" ,
105
+ "expressions.tests.ValueTests.test_output_field_decimalfield" ,
106
+ # pymongo.errors.OperationFailure: $multiply only supports numeric
107
+ # types, not date. (should be wrapped in DatabaseError).
108
+ "expressions.tests.FTimeDeltaTests.test_invalid_operator" ,
109
+ # InvalidDocument: cannot encode object of type: <class 'datetime.time'>
110
+ "expressions.tests.FTimeDeltaTests.test_time_subtraction" ,
111
+ # crash in DatabaseOperations.convert_durationfield_value():
112
+ # unsupported type for timedelta milliseconds component: Decimal128
113
+ "expressions.tests.FTimeDeltaTests.test_durationfield_multiply_divide" ,
114
+ # 'Ref' object has no attribute 'as_mql'.
115
+ "expressions.tests.BasicExpressionsTests.test_aggregate_subquery_annotation" ,
116
+ # AttributeError: pattern_ops
117
+ "expressions.tests.BasicExpressionsTests.test_annotation_with_nested_outerref" ,
118
+ "expressions.tests.BasicExpressionsTests.test_nested_outerref_with_function" ,
94
119
}
95
120
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
96
121
_django_test_expected_failures_bitwise = {
@@ -114,6 +139,10 @@ def django_test_expected_failures(self):
114
139
"Insert expressions aren't supported." : {
115
140
"bulk_create.tests.BulkCreateTests.test_bulk_insert_now" ,
116
141
"bulk_create.tests.BulkCreateTests.test_bulk_insert_expressions" ,
142
+ "expressions.tests.BasicExpressionsTests.test_new_object_create" ,
143
+ "expressions.tests.BasicExpressionsTests.test_new_object_save" ,
144
+ "expressions.tests.BasicExpressionsTests.test_object_create_with_aggregate" ,
145
+ "expressions.tests.BasicExpressionsTests.test_object_create_with_f_expression_in_subquery" ,
117
146
# PI()
118
147
"db_functions.math.test_round.RoundTests.test_decimal_with_precision" ,
119
148
"db_functions.math.test_round.RoundTests.test_float_with_precision" ,
@@ -138,6 +167,21 @@ def django_test_expected_failures(self):
138
167
"db_functions.text.test_replace.ReplaceTests.test_update" ,
139
168
"db_functions.text.test_substr.SubstrTests.test_basic" ,
140
169
"db_functions.text.test_upper.UpperTests.test_basic" ,
170
+ "expressions.tests.BasicExpressionsTests.test_arithmetic" ,
171
+ "expressions.tests.BasicExpressionsTests.test_filter_with_join" ,
172
+ "expressions.tests.BasicExpressionsTests.test_object_update" ,
173
+ "expressions.tests.BasicExpressionsTests.test_object_update_unsaved_objects" ,
174
+ "expressions.tests.BasicExpressionsTests.test_order_of_operations" ,
175
+ "expressions.tests.BasicExpressionsTests.test_parenthesis_priority" ,
176
+ "expressions.tests.BasicExpressionsTests.test_update" ,
177
+ "expressions.tests.BasicExpressionsTests.test_update_with_fk" ,
178
+ "expressions.tests.BasicExpressionsTests.test_update_with_none" ,
179
+ "expressions.tests.ExpressionsNumericTests.test_decimal_expression" ,
180
+ "expressions.tests.ExpressionsNumericTests.test_increment_value" ,
181
+ "expressions.tests.FTimeDeltaTests.test_delta_update" ,
182
+ "expressions.tests.FTimeDeltaTests.test_negative_timedelta_update" ,
183
+ "expressions.tests.ValueTests.test_update_TimeField_using_Value" ,
184
+ "expressions.tests.ValueTests.test_update_UUIDField_using_Value" ,
141
185
"expressions_case.tests.CaseDocumentationExamples.test_conditional_update_example" ,
142
186
"expressions_case.tests.CaseExpressionTests.test_update" ,
143
187
"expressions_case.tests.CaseExpressionTests.test_update_big_integer" ,
@@ -215,6 +259,9 @@ def django_test_expected_failures(self):
215
259
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_subquery_and_aggregate_values_chaining" ,
216
260
"annotations.tests.NonAggregateAnnotationTestCase.test_filter_agg_with_double_f" ,
217
261
"annotations.tests.NonAggregateAnnotationTestCase.test_values_with_pk_annotation" ,
262
+ "expressions.test_queryset_values.ValuesExpressionsTests.test_chained_values_with_expression" ,
263
+ "expressions.test_queryset_values.ValuesExpressionsTests.test_values_expression_group_by" ,
264
+ "expressions.tests.BasicExpressionsTests.test_annotate_values_aggregate" ,
218
265
"expressions_case.tests.CaseExpressionTests.test_aggregate" ,
219
266
"expressions_case.tests.CaseExpressionTests.test_aggregate_with_expression_as_condition" ,
220
267
"expressions_case.tests.CaseExpressionTests.test_aggregate_with_expression_as_value" ,
@@ -251,6 +298,7 @@ def django_test_expected_failures(self):
251
298
"defer_regress.tests.DeferRegressionTest.test_basic" ,
252
299
"defer_regress.tests.DeferRegressionTest.test_defer_annotate_select_related" ,
253
300
"defer_regress.tests.DeferRegressionTest.test_ticket_16409" ,
301
+ "expressions.tests.FieldTransformTests.test_month_aggregation" ,
254
302
"expressions_case.tests.CaseDocumentationExamples.test_conditional_aggregation_example" ,
255
303
# Func not implemented.
256
304
"annotations.tests.NonAggregateAnnotationTestCase.test_custom_functions" ,
@@ -269,6 +317,17 @@ def django_test_expected_failures(self):
269
317
},
270
318
"Exists is not supported on MongoDB." : {
271
319
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_exists_none_query" ,
320
+ "expressions.tests.BasicExpressionsTests.test_annotation_with_deeply_nested_outerref" ,
321
+ "expressions.tests.BasicExpressionsTests.test_boolean_expression_combined" ,
322
+ "expressions.tests.BasicExpressionsTests.test_boolean_expression_combined_with_empty_Q" ,
323
+ "expressions.tests.BasicExpressionsTests.test_boolean_expression_in_Q" ,
324
+ "expressions.tests.BasicExpressionsTests.test_case_in_filter_if_boolean_output_field" ,
325
+ "expressions.tests.BasicExpressionsTests.test_exists_in_filter" ,
326
+ "expressions.tests.BasicExpressionsTests.test_subquery" ,
327
+ "expressions.tests.ExistsTests.test_filter_by_empty_exists" ,
328
+ "expressions.tests.ExistsTests.test_negated_empty_exists" ,
329
+ "expressions.tests.ExistsTests.test_optimizations" ,
330
+ "expressions.tests.ExistsTests.test_select_negated_empty_exists" ,
272
331
"lookup.tests.LookupTests.test_exact_exists" ,
273
332
"lookup.tests.LookupTests.test_nested_outerref_lhs" ,
274
333
"lookup.tests.LookupQueryingTests.test_filter_exists_lhs" ,
@@ -279,6 +338,21 @@ def django_test_expected_failures(self):
279
338
"annotations.tests.NonAggregateAnnotationTestCase.test_empty_queryset_annotation" ,
280
339
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_outerref" ,
281
340
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_subquery_with_parameters" ,
341
+ "expressions.tests.BasicExpressionsTests.test_annotation_with_outerref" ,
342
+ "expressions.tests.BasicExpressionsTests.test_annotations_within_subquery" ,
343
+ "expressions.tests.BasicExpressionsTests.test_in_subquery" ,
344
+ "expressions.tests.BasicExpressionsTests.test_nested_subquery" ,
345
+ "expressions.tests.BasicExpressionsTests.test_nested_subquery_join_outer_ref" ,
346
+ "expressions.tests.BasicExpressionsTests.test_nested_subquery_outer_ref_2" ,
347
+ "expressions.tests.BasicExpressionsTests.test_nested_subquery_outer_ref_with_autofield" ,
348
+ "expressions.tests.BasicExpressionsTests.test_outerref_mixed_case_table_name" ,
349
+ "expressions.tests.BasicExpressionsTests.test_outerref_with_operator" ,
350
+ "expressions.tests.BasicExpressionsTests.test_subquery_filter_by_aggregate" ,
351
+ "expressions.tests.BasicExpressionsTests.test_subquery_filter_by_lazy" ,
352
+ "expressions.tests.BasicExpressionsTests.test_subquery_group_by_outerref_in_filter" ,
353
+ "expressions.tests.BasicExpressionsTests.test_subquery_in_filter" ,
354
+ "expressions.tests.BasicExpressionsTests.test_subquery_references_joined_table_twice" ,
355
+ "expressions.tests.BasicExpressionsTests.test_uuid_pk_subquery" ,
282
356
"lookup.tests.LookupQueryingTests.test_filter_subquery_lhs" ,
283
357
"model_fields.test_jsonfield.TestQuerying.test_nested_key_transform_on_subquery" ,
284
358
"model_fields.test_jsonfield.TestQuerying.test_obj_subquery_lookup" ,
@@ -288,6 +362,9 @@ def django_test_expected_failures(self):
288
362
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_and_alias_filter_related_in_subquery" ,
289
363
"annotations.tests.NonAggregateAnnotationTestCase.test_empty_expression_annotation" ,
290
364
"db_functions.comparison.test_coalesce.CoalesceTests.test_empty_queryset" ,
365
+ "expressions.tests.FTimeDeltaTests.test_date_subquery_subtraction" ,
366
+ "expressions.tests.FTimeDeltaTests.test_datetime_subquery_subtraction" ,
367
+ "expressions.tests.FTimeDeltaTests.test_time_subquery_subtraction" ,
291
368
"expressions_case.tests.CaseExpressionTests.test_in_subquery" ,
292
369
"lookup.tests.LookupTests.test_exact_query_rhs_with_selected_columns" ,
293
370
"lookup.tests.LookupTests.test_exact_sliced_queryset_limit_one" ,
@@ -342,6 +419,8 @@ def django_test_expected_failures(self):
342
419
},
343
420
"Test executes raw SQL." : {
344
421
"annotations.tests.NonAggregateAnnotationTestCase.test_raw_sql_with_inherited_field" ,
422
+ "expressions.tests.BasicExpressionsTests.test_annotate_values_filter" ,
423
+ "expressions.tests.BasicExpressionsTests.test_filtering_on_rawsql_that_is_boolean" ,
345
424
"model_fields.test_jsonfield.TestQuerying.test_key_sql_injection_escape" ,
346
425
"model_fields.test_jsonfield.TestQuerying.test_key_transform_raw_expression" ,
347
426
"model_fields.test_jsonfield.TestQuerying.test_nested_key_transform_raw_expression" ,
@@ -381,6 +460,7 @@ def django_test_expected_failures(self):
381
460
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_date_func" ,
382
461
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_date_none" ,
383
462
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_lookup_name_sql_injection" ,
463
+ "expressions.tests.FieldTransformTests.test_multiple_transforms_in_values" ,
384
464
"model_fields.test_datetimefield.DateTimeFieldTests.test_lookup_date_with_use_tz" ,
385
465
"model_fields.test_datetimefield.DateTimeFieldTests.test_lookup_date_without_use_tz" ,
386
466
"timezones.tests.NewDatabaseTests.test_query_convert_timezones" ,
0 commit comments