Fixed -- Removed time.sleep(1) before dropping the test database.
Uncertain if this is needed, but no failures have appeared so far.
import sys
-import time
from django.apps import apps
from django.conf import settings
@@ -277,8 +276,6 @@ class BaseDatabaseCreation(object):
# to do so, because it's not allowed to delete a database while being
# connected to it.
with self.connection._nodb_connection.cursor() as cursor:
- # Wait to avoid "database is being accessed by other users" errors.
- time.sleep(1)
cursor.execute("DROP DATABASE %s"
% self.connection.ops.quote_name(test_database_name))
