We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1157a7c commit f2b7a93Copy full SHA for f2b7a93
pytest_django/plugin.py
@@ -800,8 +800,9 @@ def _dj_db_wrapper(self) -> django.db.backends.base.base.BaseDatabaseWrapper:
800
801
# The first time the _dj_db_wrapper is accessed, we will save a
802
# reference to the real implementation.
803
- if self._real_ensure_connection is None:
804
- self._real_ensure_connection = BaseDatabaseWrapper.ensure_connection
+ if not hasattr(BaseDatabaseWrapper, "_real_ensure_connection"):
+ BaseDatabaseWrapper._real_ensure_connection = BaseDatabaseWrapper.ensure_connection
805
+ self._real_ensure_connection = BaseDatabaseWrapper._real_ensure_connection
806
807
return BaseDatabaseWrapper
808
0 commit comments