Skip to content

Commit c008bff

Browse files
committed
add skips for expressions tests
1 parent aa95fea commit c008bff

File tree

2 files changed

+82
-8
lines changed

2 files changed

+82
-8
lines changed

.github/workflows/test-python.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,7 @@ jobs:
7676
datetimes
7777
db_functions
7878
empty
79-
expressions.tests.BasicExpressionsTests.test_ticket_11722_iexact_lookup
80-
expressions.tests.BasicExpressionsTests.test_ticket_16731_startswith_lookup
81-
expressions.tests.ExpressionOperatorTests
82-
expressions.tests.ExpressionsTests.test_insensitive_patterns_escape
83-
expressions.tests.ExpressionsTests.test_patterns_escape
84-
expressions.tests.FieldTransformTests.test_transform_in_values
85-
expressions.tests.FTimeDeltaTests.test_date_minus_duration
86-
expressions.tests.NegatedExpressionTests
79+
expressions
8780
expressions_case
8881
defer
8982
defer_regress

django_mongodb/features.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
1212
supports_json_field_contains = False
1313
# BSON Date type doesn't support microsecond precision.
1414
supports_microsecond_precision = False
15+
supports_temporal_subtraction = True
1516
# MongoDB stores datetimes in UTC.
1617
supports_timezones = False
1718
# Not implemented: https://github.com/mongodb-labs/django-mongodb/issues/7
@@ -34,6 +35,8 @@ class DatabaseFeatures(BaseDatabaseFeatures):
3435
"db_functions.tests.FunctionTests.test_nested_function_ordering",
3536
"db_functions.text.test_length.LengthTests.test_ordering",
3637
"db_functions.text.test_strindex.StrIndexTests.test_order_by",
38+
"expressions.tests.BasicExpressionsTests.test_order_by_exists",
39+
"expressions.tests.BasicExpressionsTests.test_order_by_multiline_sql",
3740
"expressions_case.tests.CaseExpressionTests.test_order_by_conditional_explicit",
3841
"lookup.tests.LookupQueryingTests.test_lookup_in_order_by",
3942
"ordering.tests.OrderingTests.test_default_ordering_by_f_expression",
@@ -66,7 +69,25 @@ class DatabaseFeatures(BaseDatabaseFeatures):
6669
"model_fields.test_jsonfield.TestQuerying.test_order_grouping_custom_decoder",
6770
"model_fields.test_jsonfield.TestQuerying.test_ordering_by_transform",
6871
"model_fields.test_jsonfield.TestQuerying.test_ordering_grouping_by_key_transform",
72+
# DatabaseOperations.convert_decimalfield_value() crash:
73+
# 'int' object has no attribute 'to_decimal'.
74+
"expressions.tests.ExpressionsNumericTests.test_filter_decimal_expression",
75+
"expressions.tests.ValueTests.test_output_field_decimalfield",
76+
# pymongo.errors.OperationFailure: $multiply only supports numeric
77+
# types, not date. (should be wrapped in DatabaseError).
78+
"expressions.tests.FTimeDeltaTests.test_invalid_operator",
79+
# InvalidDocument: cannot encode object of type: <class 'datetime.time'>
80+
"expressions.tests.FTimeDeltaTests.test_time_subtraction",
81+
# crash in DatabaseOperations.convert_durationfield_value():
82+
# unsupported type for timedelta milliseconds component: Decimal128
83+
"expressions.tests.FTimeDeltaTests.test_durationfield_multiply_divide",
84+
# 'Ref' object has no attribute 'as_mql'.
85+
"expressions.tests.BasicExpressionsTests.test_aggregate_subquery_annotation",
86+
# AttributeError: pattern_ops
87+
"expressions.tests.BasicExpressionsTests.test_annotation_with_nested_outerref",
88+
"expressions.tests.BasicExpressionsTests.test_nested_outerref_with_function",
6989
}
90+
7091
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
7192
_django_test_expected_failures_bitwise = {
7293
"expressions.tests.ExpressionOperatorTests.test_lefthand_bitwise_and",
@@ -89,6 +110,10 @@ def django_test_expected_failures(self):
89110
"Insert expressions aren't supported.": {
90111
"bulk_create.tests.BulkCreateTests.test_bulk_insert_now",
91112
"bulk_create.tests.BulkCreateTests.test_bulk_insert_expressions",
113+
"expressions.tests.BasicExpressionsTests.test_new_object_create",
114+
"expressions.tests.BasicExpressionsTests.test_new_object_save",
115+
"expressions.tests.BasicExpressionsTests.test_object_create_with_aggregate",
116+
"expressions.tests.BasicExpressionsTests.test_object_create_with_f_expression_in_subquery",
92117
# PI()
93118
"db_functions.math.test_round.RoundTests.test_decimal_with_precision",
94119
"db_functions.math.test_round.RoundTests.test_float_with_precision",
@@ -113,6 +138,21 @@ def django_test_expected_failures(self):
113138
"db_functions.text.test_replace.ReplaceTests.test_update",
114139
"db_functions.text.test_substr.SubstrTests.test_basic",
115140
"db_functions.text.test_upper.UpperTests.test_basic",
141+
"expressions.tests.BasicExpressionsTests.test_arithmetic",
142+
"expressions.tests.BasicExpressionsTests.test_filter_with_join",
143+
"expressions.tests.BasicExpressionsTests.test_object_update",
144+
"expressions.tests.BasicExpressionsTests.test_object_update_unsaved_objects",
145+
"expressions.tests.BasicExpressionsTests.test_order_of_operations",
146+
"expressions.tests.BasicExpressionsTests.test_parenthesis_priority",
147+
"expressions.tests.BasicExpressionsTests.test_update",
148+
"expressions.tests.BasicExpressionsTests.test_update_with_fk",
149+
"expressions.tests.BasicExpressionsTests.test_update_with_none",
150+
"expressions.tests.ExpressionsNumericTests.test_decimal_expression",
151+
"expressions.tests.ExpressionsNumericTests.test_increment_value",
152+
"expressions.tests.FTimeDeltaTests.test_delta_update",
153+
"expressions.tests.FTimeDeltaTests.test_negative_timedelta_update",
154+
"expressions.tests.ValueTests.test_update_TimeField_using_Value",
155+
"expressions.tests.ValueTests.test_update_UUIDField_using_Value",
116156
"expressions_case.tests.CaseDocumentationExamples.test_conditional_update_example",
117157
"expressions_case.tests.CaseExpressionTests.test_update",
118158
"expressions_case.tests.CaseExpressionTests.test_update_big_integer",
@@ -211,6 +251,8 @@ def django_test_expected_failures(self):
211251
"expressions_case.tests.CaseExpressionTests.test_aggregate_with_expression_as_value",
212252
"expressions_case.tests.CaseExpressionTests.test_aggregation_empty_cases",
213253
"lookup.tests.LookupQueryingTests.test_aggregate_combined_lookup",
254+
"expressions.test_queryset_values.ValuesExpressionsTests.test_chained_values_with_expression",
255+
"expressions.test_queryset_values.ValuesExpressionsTests.test_values_expression_group_by",
214256
"from_db_value.tests.FromDBValueTest.test_aggregation",
215257
"timezones.tests.LegacyDatabaseTests.test_query_aggregation",
216258
"timezones.tests.NewDatabaseTests.test_query_aggregation",
@@ -227,6 +269,7 @@ def django_test_expected_failures(self):
227269
"annotations.tests.NonAggregateAnnotationTestCase.test_full_expression_annotation_with_aggregation",
228270
"annotations.tests.NonAggregateAnnotationTestCase.test_grouping_by_q_expression_annotation",
229271
"annotations.tests.NonAggregateAnnotationTestCase.test_q_expression_annotation_with_aggregation",
272+
"expressions.tests.FieldTransformTests.test_month_aggregation",
230273
"expressions_case.tests.CaseDocumentationExamples.test_conditional_aggregation_example",
231274
# Func not implemented.
232275
"annotations.tests.NonAggregateAnnotationTestCase.test_custom_functions",
@@ -245,6 +288,17 @@ def django_test_expected_failures(self):
245288
},
246289
"Exists is not supported on MongoDB.": {
247290
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_exists_none_query",
291+
"expressions.tests.BasicExpressionsTests.test_annotation_with_deeply_nested_outerref",
292+
"expressions.tests.BasicExpressionsTests.test_boolean_expression_combined",
293+
"expressions.tests.BasicExpressionsTests.test_boolean_expression_combined_with_empty_Q",
294+
"expressions.tests.BasicExpressionsTests.test_boolean_expression_in_Q",
295+
"expressions.tests.BasicExpressionsTests.test_case_in_filter_if_boolean_output_field",
296+
"expressions.tests.BasicExpressionsTests.test_exists_in_filter",
297+
"expressions.tests.BasicExpressionsTests.test_subquery",
298+
"expressions.tests.ExistsTests.test_filter_by_empty_exists",
299+
"expressions.tests.ExistsTests.test_negated_empty_exists",
300+
"expressions.tests.ExistsTests.test_optimizations",
301+
"expressions.tests.ExistsTests.test_select_negated_empty_exists",
248302
"lookup.tests.LookupTests.test_exact_exists",
249303
"lookup.tests.LookupTests.test_nested_outerref_lhs",
250304
"lookup.tests.LookupQueryingTests.test_filter_exists_lhs",
@@ -253,6 +307,19 @@ def django_test_expected_failures(self):
253307
"annotations.tests.NonAggregateAnnotationTestCase.test_empty_queryset_annotation",
254308
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_outerref",
255309
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_subquery_with_parameters",
310+
"expressions.tests.BasicExpressionsTests.test_annotation_with_outerref",
311+
"expressions.tests.BasicExpressionsTests.test_annotations_within_subquery",
312+
"expressions.tests.BasicExpressionsTests.test_in_subquery",
313+
"expressions.tests.BasicExpressionsTests.test_nested_subquery",
314+
"expressions.tests.BasicExpressionsTests.test_nested_subquery_join_outer_ref",
315+
"expressions.tests.BasicExpressionsTests.test_nested_subquery_outer_ref_2",
316+
"expressions.tests.BasicExpressionsTests.test_nested_subquery_outer_ref_with_autofield",
317+
"expressions.tests.BasicExpressionsTests.test_subquery_filter_by_aggregate",
318+
"expressions.tests.BasicExpressionsTests.test_subquery_filter_by_lazy",
319+
"expressions.tests.BasicExpressionsTests.test_subquery_group_by_outerref_in_filter",
320+
"expressions.tests.BasicExpressionsTests.test_subquery_in_filter",
321+
"expressions.tests.BasicExpressionsTests.test_subquery_references_joined_table_twice",
322+
"expressions.tests.BasicExpressionsTests.test_uuid_pk_subquery",
256323
"lookup.tests.LookupQueryingTests.test_filter_subquery_lhs",
257324
"model_fields.test_jsonfield.TestQuerying.test_nested_key_transform_on_subquery",
258325
"model_fields.test_jsonfield.TestQuerying.test_obj_subquery_lookup",
@@ -261,6 +328,9 @@ def django_test_expected_failures(self):
261328
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_and_alias_filter_in_subquery",
262329
"annotations.tests.NonAggregateAnnotationTestCase.test_empty_expression_annotation",
263330
"db_functions.comparison.test_coalesce.CoalesceTests.test_empty_queryset",
331+
"expressions.tests.FTimeDeltaTests.test_date_subquery_subtraction",
332+
"expressions.tests.FTimeDeltaTests.test_datetime_subquery_subtraction",
333+
"expressions.tests.FTimeDeltaTests.test_time_subquery_subtraction",
264334
"expressions_case.tests.CaseExpressionTests.test_in_subquery",
265335
"lookup.tests.LookupTests.test_in_different_database",
266336
"model_fields.test_jsonfield.TestQuerying.test_usage_in_subquery",
@@ -326,6 +396,14 @@ def django_test_expected_failures(self):
326396
"defer.tests.DeferTests.test_only_baseclass_when_subclass_has_no_added_fields",
327397
"defer.tests.TestDefer2.test_defer_inheritance_pk_chaining",
328398
"defer_regress.tests.DeferRegressionTest.test_ticket_16409",
399+
"expressions.test_queryset_values.ValuesExpressionsTests.test_values_expression",
400+
"expressions.test_queryset_values.ValuesExpressionsTests.test_values_list_expression",
401+
"expressions.test_queryset_values.ValuesExpressionsTests.test_values_list_expression_flat",
402+
"expressions.tests.BasicExpressionsTests.test_annotate_values_aggregate",
403+
"expressions.tests.BasicExpressionsTests.test_outerref_mixed_case_table_name",
404+
"expressions.tests.BasicExpressionsTests.test_outerref_with_operator",
405+
"expressions.tests.IterableLookupInnerExpressionsTests.test_expressions_in_lookups_join_choice",
406+
"expressions.tests.IterableLookupInnerExpressionsTests.test_in_lookup_allows_F_expressions_and_expressions_for_datetimes",
329407
"expressions_case.tests.CaseExpressionTests.test_annotate_with_aggregation_in_condition",
330408
"expressions_case.tests.CaseExpressionTests.test_annotate_with_aggregation_in_predicate",
331409
"expressions_case.tests.CaseExpressionTests.test_annotate_with_aggregation_in_value",
@@ -382,6 +460,8 @@ def django_test_expected_failures(self):
382460
},
383461
"Test executes raw SQL.": {
384462
"annotations.tests.NonAggregateAnnotationTestCase.test_raw_sql_with_inherited_field",
463+
"expressions.tests.BasicExpressionsTests.test_annotate_values_filter",
464+
"expressions.tests.BasicExpressionsTests.test_filtering_on_rawsql_that_is_boolean",
385465
"model_fields.test_jsonfield.TestQuerying.test_key_sql_injection_escape",
386466
"model_fields.test_jsonfield.TestQuerying.test_key_transform_raw_expression",
387467
"model_fields.test_jsonfield.TestQuerying.test_nested_key_transform_raw_expression",
@@ -421,6 +501,7 @@ def django_test_expected_failures(self):
421501
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_date_func",
422502
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_date_none",
423503
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_lookup_name_sql_injection",
504+
"expressions.tests.FieldTransformTests.test_multiple_transforms_in_values",
424505
"model_fields.test_datetimefield.DateTimeFieldTests.test_lookup_date_with_use_tz",
425506
"model_fields.test_datetimefield.DateTimeFieldTests.test_lookup_date_without_use_tz",
426507
"timezones.tests.NewDatabaseTests.test_query_convert_timezones",

0 commit comments

Comments
 (0)