summaryrefslogtreecommitdiff
path: root/tests/backends/postgresql/tests.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-12-22 20:32:55 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-12-22 20:33:49 +0100
commitb5f60ef5a74a86bf8d7fbebf2000284bffb61aac (patch)
treeaf69f9e578b99ea886b1a5be4ffa1b2cc6c3ae05 /tests/backends/postgresql/tests.py
parenta0e01b000a0d1960cf23f35daf9c60f812671f3b (diff)
[4.0.x] Refs #32355 -- Bumped required psycopg2 version to 2.8.4.
psycopg2 2.8.4 is the first release to support Python 3.8. Backport of ca04659b4b3f042c1bc7e557c25ed91e3c56c745 from main
Diffstat (limited to 'tests/backends/postgresql/tests.py')
-rw-r--r--tests/backends/postgresql/tests.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/backends/postgresql/tests.py b/tests/backends/postgresql/tests.py
index e8dfcf2f62..1905147f6f 100644
--- a/tests/backends/postgresql/tests.py
+++ b/tests/backends/postgresql/tests.py
@@ -207,9 +207,7 @@ class Tests(TestCase):
The transaction level can be configured with
DATABASES ['OPTIONS']['isolation_level'].
"""
- import psycopg2
from psycopg2.extensions import (
- ISOLATION_LEVEL_READ_COMMITTED as read_committed,
ISOLATION_LEVEL_SERIALIZABLE as serializable,
)
@@ -217,8 +215,7 @@ class Tests(TestCase):
# and the isolation level isn't reported as 0. This test assumes that
# PostgreSQL is configured with the default isolation level.
# Check the level on the psycopg2 connection, not the Django wrapper.
- default_level = read_committed if psycopg2.__version__ < '2.7' else None
- self.assertEqual(connection.connection.isolation_level, default_level)
+ self.assertIsNone(connection.connection.isolation_level)
new_connection = connection.copy()
new_connection.settings_dict['OPTIONS']['isolation_level'] = serializable