2
2
3
3
4
4
class DatabaseFeatures (BaseDatabaseFeatures ):
5
+ greatest_least_ignores_nulls = True
6
+ has_json_object_function = False
5
7
supports_date_lookup_using_string = False
6
8
supports_foreign_keys = False
7
9
supports_ignore_conflicts = False
@@ -29,6 +31,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
29
31
"lookup.tests.LookupTests.test_count" ,
30
32
# Lookup in order_by() not supported:
31
33
# unsupported operand type(s) for %: 'function' and 'str'
34
+ "db_functions.comparison.test_coalesce.CoalesceTests.test_ordering" ,
32
35
"lookup.tests.LookupQueryingTests.test_lookup_in_order_by" ,
33
36
# annotate() after values() doesn't raise NotSupportedError.
34
37
"lookup.tests.LookupTests.test_exact_query_rhs_with_selected_columns" ,
@@ -50,6 +53,8 @@ class DatabaseFeatures(BaseDatabaseFeatures):
50
53
# the result back to UTC.
51
54
"db_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests.test_trunc_func_with_timezone" ,
52
55
"db_functions.datetime.test_extract_trunc.DateFunctionWithTimeZoneTests.test_trunc_timezone_applied_before_truncation" ,
56
+ # Coalesce() with expressions doesn't generate correct query.
57
+ "db_functions.comparison.test_coalesce.CoalesceTests.test_mixed_values" ,
53
58
}
54
59
55
60
django_test_skips = {
@@ -73,6 +78,8 @@ class DatabaseFeatures(BaseDatabaseFeatures):
73
78
"QuerySet.update() with expression not supported." : {
74
79
"annotations.tests.AliasTests.test_update_with_alias" ,
75
80
"annotations.tests.NonAggregateAnnotationTestCase.test_update_with_annotation" ,
81
+ "db_functions.comparison.test_least.LeastTests.test_update" ,
82
+ "db_functions.comparison.test_greatest.GreatestTests.test_update" ,
76
83
"model_fields.test_integerfield.PositiveIntegerFieldTests.test_negative_values" ,
77
84
"timezones.tests.NewDatabaseTests.test_update_with_timedelta" ,
78
85
"update.tests.AdvancedTests.test_update_annotated_queryset" ,
@@ -123,6 +130,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
123
130
"queries.test_bulk_update.BulkUpdateTests.test_database_routing_batch_atomicity" ,
124
131
},
125
132
"Test assumes integer primary key." : {
133
+ "db_functions.comparison.test_cast.CastTests.test_cast_to_integer_foreign_key" ,
126
134
"model_fields.test_foreignkey.ForeignKeyTests.test_to_python" ,
127
135
},
128
136
# https://github.com/mongodb-labs/django-mongodb/issues/12
@@ -160,6 +168,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
160
168
"lookup.tests.LookupQueryingTests.test_filter_lookup_lhs" ,
161
169
# Subquery not supported.
162
170
"annotations.tests.NonAggregateAnnotationTestCase.test_empty_queryset_annotation" ,
171
+ "db_functions.comparison.test_coalesce.CoalesceTests.test_empty_queryset" ,
163
172
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_extract_outerref" ,
164
173
"db_functions.datetime.test_extract_trunc.DateFunctionTests.test_trunc_subquery_with_parameters" ,
165
174
"lookup.tests.LookupQueryingTests.test_filter_subquery_lhs" ,
@@ -186,8 +195,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
186
195
"annotations.tests.NonAggregateAnnotationTestCase.test_custom_functions_can_ref_other_functions" ,
187
196
# Floor not implemented.
188
197
"annotations.tests.NonAggregateAnnotationTestCase.test_custom_transform_annotation" ,
189
- # Coalesce not implemented.
190
- "annotations.tests.AliasTests.test_alias_annotation_expression" ,
198
+ # annotate() with expression that raises FullResultSet crashes.
191
199
"annotations.tests.NonAggregateAnnotationTestCase.test_full_expression_wrapped_annotation" ,
192
200
# BaseDatabaseOperations may require a format_for_duration_arithmetic().
193
201
"annotations.tests.NonAggregateAnnotationTestCase.test_mixed_type_annotation_date_interval" ,
@@ -206,6 +214,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
206
214
"annotations.tests.AliasTests.test_order_by_alias_aggregate" ,
207
215
"annotations.tests.NonAggregateAnnotationTestCase.test_annotate_exists" ,
208
216
"annotations.tests.NonAggregateAnnotationTestCase.test_annotate_with_aggregation" ,
217
+ "db_functions.comparison.test_cast.CastTests.test_cast_from_db_datetime_to_date_group_by" ,
209
218
},
210
219
"QuerySet.dates() is not supported on MongoDB." : {
211
220
"annotations.tests.AliasTests.test_dates_alias" ,
@@ -246,6 +255,8 @@ class DatabaseFeatures(BaseDatabaseFeatures):
246
255
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_subquery_outerref_transform" ,
247
256
"annotations.tests.NonAggregateAnnotationTestCase.test_annotation_with_m2m" ,
248
257
"annotations.tests.NonAggregateAnnotationTestCase.test_chaining_annotation_filter_with_m2m" ,
258
+ "db_functions.comparison.test_least.LeastTests.test_related_field" ,
259
+ "db_functions.comparison.test_greatest.GreatestTests.test_related_field" ,
249
260
"defer.tests.BigChildDeferTests.test_defer_baseclass_when_subclass_has_added_field" ,
250
261
"defer.tests.BigChildDeferTests.test_defer_subclass" ,
251
262
"defer.tests.BigChildDeferTests.test_defer_subclass_both" ,
@@ -331,4 +342,14 @@ class DatabaseFeatures(BaseDatabaseFeatures):
331
342
"MongoDB can't annotate ($project) a function like PI()." : {
332
343
"db_functions.math.test_pi.PiTests.test" ,
333
344
},
345
+ "Can't cast from date to datetime without MongoDB interpreting the new value in UTC." : {
346
+ "db_functions.comparison.test_cast.CastTests.test_cast_from_db_date_to_datetime" ,
347
+ "db_functions.comparison.test_cast.CastTests.test_cast_from_db_datetime_to_time" ,
348
+ },
349
+ "Casting Python literals doesn't work." : {
350
+ "db_functions.comparison.test_cast.CastTests.test_cast_from_python" ,
351
+ "db_functions.comparison.test_cast.CastTests.test_cast_from_python_to_date" ,
352
+ "db_functions.comparison.test_cast.CastTests.test_cast_from_python_to_datetime" ,
353
+ "db_functions.comparison.test_cast.CastTests.test_cast_to_duration" ,
354
+ },
334
355
}
0 commit comments