mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #27830 -- Used distutils.version.LooseVersion for version parsing.
This commit is contained in:
parent
e7dc39fb65
commit
08bda82c23
10 changed files with 52 additions and 45 deletions
|
@ -323,13 +323,12 @@ class PostgreSQLTests(TestCase):
|
|||
|
||||
def test_correct_extraction_psycopg2_version(self):
|
||||
from django.db.backends.postgresql.base import psycopg2_version
|
||||
version_path = 'django.db.backends.postgresql.base.Database.__version__'
|
||||
|
||||
with mock.patch(version_path, '2.6.9'):
|
||||
self.assertEqual(psycopg2_version(), (2, 6, 9))
|
||||
with mock.patch('psycopg2.__version__', '4.2.1 (dt dec pq3 ext lo64)'):
|
||||
self.assertEqual(psycopg2_version(), (4, 2, 1))
|
||||
|
||||
with mock.patch(version_path, '2.5.dev0'):
|
||||
self.assertEqual(psycopg2_version(), (2, 5))
|
||||
with mock.patch('psycopg2.__version__', '4.2b0.dev1 (dt dec pq3 ext lo64)'):
|
||||
self.assertEqual(psycopg2_version(), (4, 2))
|
||||
|
||||
|
||||
class DateQuotingTest(TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue