Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
1739ae9e
Kaydet (Commit)
1739ae9e
authored
Kas 29, 2014
tarafından
Andriy Sokolovskiy
Kaydeden (comit)
Tim Graham
Ara 01, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #23807 -- Ignored non-digits in psycopg2 version
üst
b8cc5f3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
base.py
django/db/backends/postgresql_psycopg2/base.py
+1
-1
tests.py
tests/backends/tests.py
+11
-1
No files found.
django/db/backends/postgresql_psycopg2/base.py
Dosyayı görüntüle @
1739ae9e
...
...
@@ -216,7 +216,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
@cached_property
def
psycopg2_version
(
self
):
version
=
psycopg2
.
__version__
.
split
(
' '
,
1
)[
0
]
return
tuple
(
int
(
v
)
for
v
in
version
.
split
(
'.'
))
return
tuple
(
int
(
v
)
for
v
in
version
.
split
(
'.'
)
if
v
.
isdigit
()
)
@cached_property
def
pg_version
(
self
):
...
...
tests/backends/tests.py
Dosyayı görüntüle @
1739ae9e
...
...
@@ -22,7 +22,7 @@ from django.db.backends.utils import format_number, CursorWrapper
from
django.db.models
import
Sum
,
Avg
,
Variance
,
StdDev
from
django.db.models.sql.constants
import
CURSOR
from
django.db.utils
import
ConnectionHandler
from
django.test
import
(
TestCase
,
TransactionTestCase
,
override_settings
,
from
django.test
import
(
TestCase
,
TransactionTestCase
,
mock
,
override_settings
,
skipUnlessDBFeature
,
skipIfDBFeature
)
from
django.test.utils
import
str_prefix
,
IgnoreAllDeprecationWarningsMixin
from
django.utils
import
six
...
...
@@ -246,6 +246,16 @@ class PostgreSQLTests(TestCase):
'istartswith'
,
'endswith'
,
'iendswith'
,
'regex'
,
'iregex'
):
self
.
assertIn
(
'::text'
,
do
.
lookup_cast
(
lookup
))
def
test_correct_extraction_psycopg2_version
(
self
):
from
django.db.backends.postgresql_psycopg2.base
import
DatabaseWrapper
version_path
=
'django.db.backends.postgresql_psycopg2.base.Database.__version__'
with
mock
.
patch
(
version_path
,
'2.6.9'
):
self
.
assertEqual
(
DatabaseWrapper
.
psycopg2_version
.
__get__
(
self
),
(
2
,
6
,
9
))
with
mock
.
patch
(
version_path
,
'2.5.dev0'
):
self
.
assertEqual
(
DatabaseWrapper
.
psycopg2_version
.
__get__
(
self
),
(
2
,
5
))
class
DateQuotingTest
(
TestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment