Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #21187 -- Import CursorWrapper from django.db.backend.utils

The import was done from util instead of utils leading to
PendingDeprecationWarning.
  • Loading branch information...
commit 47e79bfcfb65c5e7bb4e4402c593ac40def6efb4 1 parent 1a63092
@akaariai akaariai authored
Showing with 1 addition and 3 deletions.
  1. +1 −3 tests/backends/tests.py
View
4 tests/backends/tests.py
@@ -15,7 +15,7 @@
from django.db.backends.signals import connection_created
from django.db.backends.sqlite3.base import DatabaseOperations
from django.db.backends.postgresql_psycopg2 import version as pg_version
-from django.db.backends.utils import format_number
+from django.db.backends.utils import format_number, CursorWrapper
from django.db.models import Sum, Avg, Variance, StdDev
from django.db.models.fields import (AutoField, DateField, DateTimeField,
DecimalField, IntegerField, TimeField)
@@ -618,7 +618,6 @@ def test_cursor_contextmanager(self):
Test that cursors can be used as a context manager
"""
with connection.cursor() as cursor:
- from django.db.backends.util import CursorWrapper
self.assertTrue(isinstance(cursor, CursorWrapper))
# Both InterfaceError and ProgrammingError seem to be used when
# accessing closed cursor (psycopg2 has InterfaceError, rest seem
@@ -634,7 +633,6 @@ def test_cursor_contextmanager_closing(self):
# psycopg2 offers us a way to check that by closed attribute.
# So, run only on psycopg2 for that reason.
with connection.cursor() as cursor:
- from django.db.backends.util import CursorWrapper
self.assertTrue(isinstance(cursor, CursorWrapper))
self.assertTrue(cursor.closed)
Please sign in to comment.
Something went wrong with that request. Please try again.