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
650bf671
Kaydet (Commit)
650bf671
authored
May 15, 2017
tarafından
Tim Graham
Kaydeden (comit)
GitHub
May 15, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #27996 -- Skipped RandomUUID test on PostgreSQL 9.3.
üst
f0d47ab3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
functions.txt
docs/ref/contrib/postgres/functions.txt
+2
-0
__init__.py
tests/postgres_tests/__init__.py
+10
-0
test_functions.py
tests/postgres_tests/test_functions.py
+2
-1
No files found.
docs/ref/contrib/postgres/functions.txt
Dosyayı görüntüle @
650bf671
...
@@ -16,6 +16,8 @@ All of these functions are available from the
...
@@ -16,6 +16,8 @@ All of these functions are available from the
Returns a version 4 UUID.
Returns a version 4 UUID.
Requires PostgreSQL 9.4 or greater.
The `pgcrypto extension`_ must be installed. You can use the
The `pgcrypto extension`_ must be installed. You can use the
:class:`~django.contrib.postgres.operations.CryptoExtension` migration
:class:`~django.contrib.postgres.operations.CryptoExtension` migration
operation to install it.
operation to install it.
...
...
tests/postgres_tests/__init__.py
Dosyayı görüntüle @
650bf671
...
@@ -7,6 +7,16 @@ from django.db.backends.signals import connection_created
...
@@ -7,6 +7,16 @@ from django.db.backends.signals import connection_created
from
django.test
import
TestCase
,
modify_settings
from
django.test
import
TestCase
,
modify_settings
def
skipUnlessPG94
(
test
):
try
:
PG_VERSION
=
connection
.
pg_version
except
AttributeError
:
PG_VERSION
=
0
if
PG_VERSION
<
90400
:
return
unittest
.
skip
(
'PostgreSQL ≥ 9.4 required'
)(
test
)
return
test
@unittest.skipUnless
(
connection
.
vendor
==
'postgresql'
,
"PostgreSQL specific tests"
)
@unittest.skipUnless
(
connection
.
vendor
==
'postgresql'
,
"PostgreSQL specific tests"
)
class
PostgreSQLTestCase
(
TestCase
):
class
PostgreSQLTestCase
(
TestCase
):
@classmethod
@classmethod
...
...
tests/postgres_tests/test_functions.py
Dosyayı görüntüle @
650bf671
...
@@ -4,7 +4,7 @@ from time import sleep
...
@@ -4,7 +4,7 @@ from time import sleep
from
django.contrib.postgres.functions
import
RandomUUID
,
TransactionNow
from
django.contrib.postgres.functions
import
RandomUUID
,
TransactionNow
from
.
import
PostgreSQLTestCase
from
.
import
PostgreSQLTestCase
,
skipUnlessPG94
from
.models
import
NowTestModel
,
UUIDTestModel
from
.models
import
NowTestModel
,
UUIDTestModel
...
@@ -29,6 +29,7 @@ class TestTransactionNow(PostgreSQLTestCase):
...
@@ -29,6 +29,7 @@ class TestTransactionNow(PostgreSQLTestCase):
self
.
assertEqual
(
m1
.
when
,
m2
.
when
)
self
.
assertEqual
(
m1
.
when
,
m2
.
when
)
@skipUnlessPG94
class
TestRandomUUID
(
PostgreSQLTestCase
):
class
TestRandomUUID
(
PostgreSQLTestCase
):
def
test_random_uuid
(
self
):
def
test_random_uuid
(
self
):
...
...
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