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):
9292 "schema.tests.SchemaTests.test_composed_constraint_with_fk" ,
9393 "schema.tests.SchemaTests.test_remove_ignored_unique_constraint_not_create_fk_index" ,
9494 "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" ,
9795 # Handle column default value.
9896 # https://github.com/mongodb-labs/django-mongodb/issues/155
9997 "annotations.tests.NonAggregateAnnotationTestCase.test_empty_queryset_annotation" ,
@@ -396,6 +394,9 @@ def django_test_expected_failures(self):
396394 "schema.tests.SchemaTests.test_rename_column_renames_deferred_sql_references" ,
397395 "schema.tests.SchemaTests.test_rename_table_renames_deferred_sql_references" ,
398396 },
397+ "Subqueries cannot be used in delete operations" : {
398+ "delete_regress.tests.DeleteTests.test_self_reference_with_through_m2m_at_second_level"
399+ },
399400 "Test executes raw SQL." : {
400401 "aggregation.tests.AggregateTestCase.test_coalesced_empty_result_set" ,
401402 "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):
6565 @wrap_database_errors
6666 def delete (self ):
6767 """Execute a delete query."""
68+ if self .compiler .subqueries :
69+ raise NotSupportedError ("Subqueries are not supported in delete operations." )
6870 return self .collection .delete_many (self .mongo_query ).deleted_count
6971
7072 @wrap_database_errors
You can’t perform that action at this time.
0 commit comments