summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-03-01 13:17:34 -0500
committerTim Graham <timograham@gmail.com>2017-03-01 13:17:34 -0500
commit29ea9714ee23525000dd8bdb7a9aafb2147de8c7 (patch)
treef2d2217735ac8b769449684a8303a63a7e9833c6 /tests
parent49a63d08d3b3e2ac32e391d1413a4ac99429e4af (diff)
Removed PostgreSQL version detection for psycopg2 < 2.0.12.
Diffstat (limited to 'tests')
-rw-r--r--tests/backends/tests.py44
1 files changed, 0 insertions, 44 deletions
diff --git a/tests/backends/tests.py b/tests/backends/tests.py
index 460b35084a..7853d02a24 100644
--- a/tests/backends/tests.py
+++ b/tests/backends/tests.py
@@ -14,7 +14,6 @@ from django.db import (
reset_queries, transaction,
)
from django.db.backends.base.base import BaseDatabaseWrapper
-from django.db.backends.postgresql import version as pg_version
from django.db.backends.signals import connection_created
from django.db.backends.utils import CursorWrapper, format_number
from django.db.models import Avg, StdDev, Sum, Variance
@@ -190,22 +189,6 @@ class SQLiteTests(TestCase):
@unittest.skipUnless(connection.vendor == 'postgresql', "Test only for PostgreSQL")
class PostgreSQLTests(TestCase):
- def assert_parses(self, version_string, version):
- self.assertEqual(pg_version._parse_version(version_string), version)
-
- def test_parsing(self):
- """Test PostgreSQL version parsing from `SELECT version()` output"""
- self.assert_parses("PostgreSQL 9.3 beta4", 90300)
- self.assert_parses("PostgreSQL 9.3", 90300)
- self.assert_parses("EnterpriseDB 9.3", 90300)
- self.assert_parses("PostgreSQL 9.3.6", 90306)
- self.assert_parses("PostgreSQL 9.4beta1", 90400)
- self.assert_parses(
- "PostgreSQL 9.3.1 on i386-apple-darwin9.2.2, compiled by GCC "
- "i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5478)",
- 90301
- )
-
def test_nodb_connection(self):
"""
The _nodb_connection property fallbacks to the default connection
@@ -231,33 +214,6 @@ class PostgreSQLTests(TestCase):
self.assertEqual(len(w), 1)
self.assertEqual(w[0].message.__class__, RuntimeWarning)
- def test_version_detection(self):
- """Test PostgreSQL version detection"""
-
- # Helper mocks
- class CursorMock:
- "Very simple mock of DB-API cursor"
- def execute(self, arg):
- pass
-
- def fetchone(self):
- return ["PostgreSQL 9.3"]
-
- def __enter__(self):
- return self
-
- def __exit__(self, type, value, traceback):
- pass
-
- class OlderConnectionMock:
- "Mock of psycopg2 (< 2.0.12) connection"
- def cursor(self):
- return CursorMock()
-
- # psycopg2 < 2.0.12 code path
- conn = OlderConnectionMock()
- self.assertEqual(pg_version.get_version(conn), 90300)
-
def test_connect_and_rollback(self):
"""
PostgreSQL shouldn't roll back SET TIME ZONE, even if the first