@@ -34,6 +34,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
34
34
"db_functions.tests.FunctionTests.test_nested_function_ordering" ,
35
35
"db_functions.text.test_length.LengthTests.test_ordering" ,
36
36
"db_functions.text.test_strindex.StrIndexTests.test_order_by" ,
37
+ "expressions_case.tests.CaseExpressionTests.test_order_by_conditional_explicit" ,
37
38
"lookup.tests.LookupQueryingTests.test_lookup_in_order_by" ,
38
39
# annotate() after values() doesn't raise NotSupportedError.
39
40
"lookup.tests.LookupTests.test_exact_query_rhs_with_selected_columns" ,
@@ -60,6 +61,12 @@ class DatabaseFeatures(BaseDatabaseFeatures):
60
61
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_and_alias_filter_in_subquery" ,
61
62
# Length of null considered zero rather than null.
62
63
"db_functions.text.test_length.LengthTests.test_basic" ,
64
+ # annotating with Decimal() crashes: bson.errors.InvalidDocument:
65
+ # cannot encode object: Decimal('1'), of type: <class 'decimal.Decimal'>
66
+ "expressions_case.tests.CaseExpressionTests.test_annotate_filter_decimal" ,
67
+ # Case(..., then=datetime.date()) crashes: bson.errors.InvalidDocument:
68
+ # cannot encode object: datetime.date(2024, 5, 14), of type: <class 'datetime.date'>
69
+ "expressions_case.tests.CaseDocumentationExamples.test_filter_example" ,
63
70
}
64
71
# $bitAnd, #bitOr, and $bitXor are new in MongoDB 6.3.
65
72
_django_test_expected_failures_bitwise = {
@@ -107,6 +114,36 @@ def django_test_expected_failures(self):
107
114
"db_functions.text.test_replace.ReplaceTests.test_update" ,
108
115
"db_functions.text.test_substr.SubstrTests.test_basic" ,
109
116
"db_functions.text.test_upper.UpperTests.test_basic" ,
117
+ "expressions_case.tests.CaseDocumentationExamples.test_conditional_update_example" ,
118
+ "expressions_case.tests.CaseExpressionTests.test_update" ,
119
+ "expressions_case.tests.CaseExpressionTests.test_update_big_integer" ,
120
+ "expressions_case.tests.CaseExpressionTests.test_update_binary" ,
121
+ "expressions_case.tests.CaseExpressionTests.test_update_boolean" ,
122
+ "expressions_case.tests.CaseExpressionTests.test_update_date" ,
123
+ "expressions_case.tests.CaseExpressionTests.test_update_date_time" ,
124
+ "expressions_case.tests.CaseExpressionTests.test_update_decimal" ,
125
+ "expressions_case.tests.CaseExpressionTests.test_update_duration" ,
126
+ "expressions_case.tests.CaseExpressionTests.test_update_email" ,
127
+ "expressions_case.tests.CaseExpressionTests.test_update_file" ,
128
+ "expressions_case.tests.CaseExpressionTests.test_update_file_path" ,
129
+ "expressions_case.tests.CaseExpressionTests.test_update_fk" ,
130
+ "expressions_case.tests.CaseExpressionTests.test_update_float" ,
131
+ "expressions_case.tests.CaseExpressionTests.test_update_generic_ip_address" ,
132
+ "expressions_case.tests.CaseExpressionTests.test_update_image" ,
133
+ "expressions_case.tests.CaseExpressionTests.test_update_null_boolean" ,
134
+ "expressions_case.tests.CaseExpressionTests.test_update_positive_big_integer" ,
135
+ "expressions_case.tests.CaseExpressionTests.test_update_positive_integer" ,
136
+ "expressions_case.tests.CaseExpressionTests.test_update_positive_small_integer" ,
137
+ "expressions_case.tests.CaseExpressionTests.test_update_slug" ,
138
+ "expressions_case.tests.CaseExpressionTests.test_update_small_integer" ,
139
+ "expressions_case.tests.CaseExpressionTests.test_update_string" ,
140
+ "expressions_case.tests.CaseExpressionTests.test_update_text" ,
141
+ "expressions_case.tests.CaseExpressionTests.test_update_time" ,
142
+ "expressions_case.tests.CaseExpressionTests.test_update_url" ,
143
+ "expressions_case.tests.CaseExpressionTests.test_update_uuid" ,
144
+ "expressions_case.tests.CaseExpressionTests.test_update_with_expression_as_condition" ,
145
+ "expressions_case.tests.CaseExpressionTests.test_update_with_expression_as_value" ,
146
+ "expressions_case.tests.CaseExpressionTests.test_update_without_default" ,
110
147
"model_fields.test_integerfield.PositiveIntegerFieldTests.test_negative_values" ,
111
148
"timezones.tests.NewDatabaseTests.test_update_with_timedelta" ,
112
149
"update.tests.AdvancedTests.test_update_annotated_queryset" ,
@@ -169,6 +206,10 @@ def django_test_expected_failures(self):
169
206
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_in_f_grouped_by_annotation" ,
170
207
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_subquery_and_aggregate_values_chaining" ,
171
208
"annotations.tests.NonAggregateAnnotationTestCase.test_filter_agg_with_double_f" ,
209
+ "expressions_case.tests.CaseExpressionTests.test_aggregate" ,
210
+ "expressions_case.tests.CaseExpressionTests.test_aggregate_with_expression_as_condition" ,
211
+ "expressions_case.tests.CaseExpressionTests.test_aggregate_with_expression_as_value" ,
212
+ "expressions_case.tests.CaseExpressionTests.test_aggregation_empty_cases" ,
172
213
"lookup.tests.LookupQueryingTests.test_aggregate_combined_lookup" ,
173
214
"from_db_value.tests.FromDBValueTest.test_aggregation" ,
174
215
"timezones.tests.LegacyDatabaseTests.test_query_aggregation" ,
@@ -185,20 +226,20 @@ def django_test_expected_failures(self):
185
226
"lookup.tests.LookupQueryingTests.test_combined_annotated_lookups_in_filter" ,
186
227
"lookup.tests.LookupQueryingTests.test_combined_annotated_lookups_in_filter_false" ,
187
228
"lookup.tests.LookupQueryingTests.test_combined_lookups" ,
188
- # Case not supported.
189
- "lookup.tests.LookupQueryingTests.test_conditional_expression" ,
190
229
# Subquery not supported.
191
230
"annotations.tests.NonAggregateAnnotationTestCase.test_empty_queryset_annotation" ,
192
231
"db_functions.comparison.test_coalesce.CoalesceTests.test_empty_queryset" ,
193
232
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_outerref" ,
194
233
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_subquery_with_parameters" ,
234
+ "expressions_case.tests.CaseExpressionTests.test_in_subquery" ,
195
235
"lookup.tests.LookupQueryingTests.test_filter_subquery_lhs" ,
196
236
# Invalid $project :: caused by :: Unknown expression $count,
197
237
"annotations.tests.NonAggregateAnnotationTestCase.test_combined_expression_annotation_with_aggregation" ,
198
238
"annotations.tests.NonAggregateAnnotationTestCase.test_combined_f_expression_annotation_with_aggregation" ,
199
239
"annotations.tests.NonAggregateAnnotationTestCase.test_full_expression_annotation_with_aggregation" ,
200
240
"annotations.tests.NonAggregateAnnotationTestCase.test_grouping_by_q_expression_annotation" ,
201
241
"annotations.tests.NonAggregateAnnotationTestCase.test_q_expression_annotation_with_aggregation" ,
242
+ "expressions_case.tests.CaseDocumentationExamples.test_conditional_aggregation_example" ,
202
243
# Func not implemented.
203
244
"annotations.tests.NonAggregateAnnotationTestCase.test_custom_functions" ,
204
245
"annotations.tests.NonAggregateAnnotationTestCase.test_custom_functions_can_ref_other_functions" ,
@@ -209,6 +250,8 @@ def django_test_expected_failures(self):
209
250
"annotations.tests.NonAggregateAnnotationTestCase.test_order_by_aggregate" ,
210
251
"annotations.tests.NonAggregateAnnotationTestCase.test_order_by_annotation" ,
211
252
"expressions.tests.NegatedExpressionTests.test_filter" ,
253
+ "expressions_case.tests.CaseExpressionTests.test_annotate_values_not_in_order_by" ,
254
+ "expressions_case.tests.CaseExpressionTests.test_order_by_conditional_implicit" ,
212
255
# annotate().filter().count() gives incorrect results.
213
256
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_year_exact_lookup" ,
214
257
},
@@ -270,6 +313,23 @@ def django_test_expected_failures(self):
270
313
"defer.tests.DeferTests.test_only_baseclass_when_subclass_has_no_added_fields" ,
271
314
"defer.tests.TestDefer2.test_defer_inheritance_pk_chaining" ,
272
315
"defer_regress.tests.DeferRegressionTest.test_ticket_16409" ,
316
+ "expressions_case.tests.CaseExpressionTests.test_annotate_with_aggregation_in_condition" ,
317
+ "expressions_case.tests.CaseExpressionTests.test_annotate_with_aggregation_in_predicate" ,
318
+ "expressions_case.tests.CaseExpressionTests.test_annotate_with_aggregation_in_value" ,
319
+ "expressions_case.tests.CaseExpressionTests.test_annotate_with_in_clause" ,
320
+ "expressions_case.tests.CaseExpressionTests.test_annotate_with_join_in_condition" ,
321
+ "expressions_case.tests.CaseExpressionTests.test_annotate_with_join_in_predicate" ,
322
+ "expressions_case.tests.CaseExpressionTests.test_annotate_with_join_in_value" ,
323
+ "expressions_case.tests.CaseExpressionTests.test_filter_with_aggregation_in_condition" ,
324
+ "expressions_case.tests.CaseExpressionTests.test_filter_with_aggregation_in_predicate" ,
325
+ "expressions_case.tests.CaseExpressionTests.test_filter_with_aggregation_in_value" ,
326
+ "expressions_case.tests.CaseExpressionTests.test_filter_with_join_in_condition" ,
327
+ "expressions_case.tests.CaseExpressionTests.test_filter_with_join_in_predicate" ,
328
+ "expressions_case.tests.CaseExpressionTests.test_filter_with_join_in_value" ,
329
+ "expressions_case.tests.CaseExpressionTests.test_join_promotion" ,
330
+ "expressions_case.tests.CaseExpressionTests.test_join_promotion_multiple_annotations" ,
331
+ "expressions_case.tests.CaseExpressionTests.test_m2m_exclude" ,
332
+ "expressions_case.tests.CaseExpressionTests.test_m2m_reuse" ,
273
333
"lookup.test_decimalfield.DecimalFieldLookupTests" ,
274
334
"lookup.tests.LookupQueryingTests.test_multivalued_join_reuse" ,
275
335
"lookup.tests.LookupTests.test_filter_by_reverse_related_field_transform" ,
0 commit comments