Skip to content

Commit 8b727e9

Browse files
committed
prevent database flush from deleting collections
TransactionTestCase does a flush between tests leading to all tests except the first one not to have all the collections present.
1 parent c94b1b4 commit 8b727e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django_mongodb/operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def execute_sql_flush(self, tables):
175175
collection = self.connection.database[table]
176176
options = collection.options()
177177
if not options.get("capped", False):
178-
collection.drop()
178+
collection.delete_many({})
179179

180180
def prep_lookup_value(self, value, field, lookup):
181181
"""

0 commit comments

Comments
 (0)