File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
92
92
"schema.tests.SchemaTests.test_composed_constraint_with_fk" ,
93
93
"schema.tests.SchemaTests.test_remove_ignored_unique_constraint_not_create_fk_index" ,
94
94
"schema.tests.SchemaTests.test_unique_constraint" ,
95
- # Delete does not support subqueries.
96
- "delete_regress.tests.DeleteTests.test_self_reference_with_through_m2m_at_second_level" ,
97
95
# Handle column default value.
98
96
# https://github.com/mongodb-labs/django-mongodb/issues/155
99
97
"annotations.tests.NonAggregateAnnotationTestCase.test_empty_queryset_annotation" ,
@@ -396,6 +394,9 @@ def django_test_expected_failures(self):
396
394
"schema.tests.SchemaTests.test_rename_column_renames_deferred_sql_references" ,
397
395
"schema.tests.SchemaTests.test_rename_table_renames_deferred_sql_references" ,
398
396
},
397
+ "Subqueries cannot be used in delete operations" : {
398
+ "delete_regress.tests.DeleteTests.test_self_reference_with_through_m2m_at_second_level"
399
+ },
399
400
"Test executes raw SQL." : {
400
401
"aggregation.tests.AggregateTestCase.test_coalesced_empty_result_set" ,
401
402
"aggregation_regress.tests.AggregationTests.test_annotate_with_extra" ,
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ def __repr__(self):
65
65
@wrap_database_errors
66
66
def delete (self ):
67
67
"""Execute a delete query."""
68
+ if self .compiler .subqueries :
69
+ raise NotSupportedError ("Subqueries are not supported in delete operations." )
68
70
return self .collection .delete_many (self .mongo_query ).deleted_count
69
71
70
72
@wrap_database_errors
You can’t perform that action at this time.
0 commit comments