Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #22873 -- Renamed use_debug_cursor to force_debug_cursor to cla…

…rify the behavior.
  • Loading branch information...
commit 90faa196f67863370a4682ecfd053e189cd46705 1 parent 6d5daa3
@areski areski authored timgraham committed
Showing with 5 additions and 5 deletions.
  1. +2 −2 django/db/backends/__init__.py
  2. +3 −3 django/test/utils.py
View
4 django/db/backends/__init__.py
@@ -45,7 +45,7 @@ def __init__(self, settings_dict, alias=DEFAULT_DB_ALIAS,
self.alias = alias
# Query logging in debug mode or when explicitly enabled.
self.queries_log = deque(maxlen=self.queries_limit)
- self.use_debug_cursor = False
+ self.force_debug_cursor = False
# Transaction related attributes.
# Tracks if the connection is in autocommit mode. Per PEP 249, by
@@ -75,7 +75,7 @@ def __init__(self, settings_dict, alias=DEFAULT_DB_ALIAS,
@property
def queries_logged(self):
- return self.use_debug_cursor or settings.DEBUG
+ return self.force_debug_cursor or settings.DEBUG
@property
def queries(self):
View
6 django/test/utils.py
@@ -507,15 +507,15 @@ def captured_queries(self):
return self.connection.queries[self.initial_queries:self.final_queries]
def __enter__(self):
- self.use_debug_cursor = self.connection.use_debug_cursor
- self.connection.use_debug_cursor = True
+ self.force_debug_cursor = self.connection.force_debug_cursor
+ self.connection.force_debug_cursor = True
self.initial_queries = len(self.connection.queries_log)
self.final_queries = None
request_started.disconnect(reset_queries)
return self
def __exit__(self, exc_type, exc_value, traceback):
- self.connection.use_debug_cursor = self.use_debug_cursor
+ self.connection.force_debug_cursor = self.force_debug_cursor
request_started.connect(reset_queries)
if exc_type is not None:
return
Please sign in to comment.
Something went wrong with that request. Please try again.