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
00e8e514
Kaydet (Commit)
00e8e514
authored
May 30, 2015
tarafından
Marc Tamlyn
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Name PostgreSQL correctly.
üst
33ea472f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
28 deletions
+28
-28
__init__.py
tests/postgres_tests/__init__.py
+1
-1
test_aggregates.py
tests/postgres_tests/test_aggregates.py
+3
-3
test_array.py
tests/postgres_tests/test_array.py
+8
-8
test_hstore.py
tests/postgres_tests/test_hstore.py
+7
-7
test_json.py
tests/postgres_tests/test_json.py
+3
-3
test_ranges.py
tests/postgres_tests/test_ranges.py
+4
-4
test_unaccent.py
tests/postgres_tests/test_unaccent.py
+2
-2
No files found.
tests/postgres_tests/__init__.py
Dosyayı görüntüle @
00e8e514
...
...
@@ -5,5 +5,5 @@ from django.test import TestCase
@unittest.skipUnless
(
connection
.
vendor
==
'postgresql'
,
"PostgreSQL specific tests"
)
class
Postgre
s
SQLTestCase
(
TestCase
):
class
PostgreSQLTestCase
(
TestCase
):
pass
tests/postgres_tests/test_aggregates.py
Dosyayı görüntüle @
00e8e514
...
...
@@ -6,11 +6,11 @@ from django.contrib.postgres.aggregates import (
from
django.db.models.expressions
import
F
,
Value
from
django.test.utils
import
Approximate
from
.
import
Postgre
s
SQLTestCase
from
.
import
PostgreSQLTestCase
from
.models
import
AggregateTestModel
,
StatTestModel
class
TestGeneralAggregate
(
Postgre
s
SQLTestCase
):
class
TestGeneralAggregate
(
PostgreSQLTestCase
):
@classmethod
def
setUpTestData
(
cls
):
AggregateTestModel
.
objects
.
create
(
boolean_field
=
True
,
char_field
=
'Foo1'
,
integer_field
=
0
)
...
...
@@ -111,7 +111,7 @@ class TestGeneralAggregate(PostgresSQLTestCase):
self
.
assertEqual
(
values
,
{
'stringagg'
:
''
})
class
TestStatisticsAggregate
(
Postgre
s
SQLTestCase
):
class
TestStatisticsAggregate
(
PostgreSQLTestCase
):
@classmethod
def
setUpTestData
(
cls
):
StatTestModel
.
objects
.
create
(
...
...
tests/postgres_tests/test_array.py
Dosyayı görüntüle @
00e8e514
...
...
@@ -10,7 +10,7 @@ from django.db import IntegrityError, connection, models
from
django.test
import
TransactionTestCase
,
override_settings
from
django.utils
import
timezone
from
.
import
Postgre
s
SQLTestCase
from
.
import
PostgreSQLTestCase
from
.models
import
(
ArrayFieldSubclass
,
CharArrayModel
,
DateTimeArrayModel
,
IntegerArrayModel
,
NestedIntegerArrayModel
,
NullableIntegerArrayModel
,
OtherTypesArrayModel
,
...
...
@@ -23,7 +23,7 @@ except ImportError:
pass
class
TestSaveLoad
(
Postgre
s
SQLTestCase
):
class
TestSaveLoad
(
PostgreSQLTestCase
):
def
test_integer
(
self
):
instance
=
IntegerArrayModel
(
field
=
[
1
,
2
,
3
])
...
...
@@ -98,7 +98,7 @@ class TestSaveLoad(PostgresSQLTestCase):
self
.
assertEqual
(
instance
.
decimals
,
loaded
.
decimals
)
class
TestQuerying
(
Postgre
s
SQLTestCase
):
class
TestQuerying
(
PostgreSQLTestCase
):
def
setUp
(
self
):
self
.
objs
=
[
...
...
@@ -229,7 +229,7 @@ class TestQuerying(PostgresSQLTestCase):
)
class
TestChecks
(
Postgre
s
SQLTestCase
):
class
TestChecks
(
PostgreSQLTestCase
):
def
test_field_checks
(
self
):
field
=
ArrayField
(
models
.
CharField
())
...
...
@@ -294,7 +294,7 @@ class TestMigrations(TransactionTestCase):
self
.
assertNotIn
(
table_name
,
connection
.
introspection
.
table_names
(
cursor
))
class
TestSerialization
(
Postgre
s
SQLTestCase
):
class
TestSerialization
(
PostgreSQLTestCase
):
test_data
=
'[{"fields": {"field": "[
\\
"1
\\
",
\\
"2
\\
"]"}, "model": "postgres_tests.integerarraymodel", "pk": null}]'
def
test_dumping
(
self
):
...
...
@@ -307,7 +307,7 @@ class TestSerialization(PostgresSQLTestCase):
self
.
assertEqual
(
instance
.
field
,
[
1
,
2
])
class
TestValidation
(
Postgre
s
SQLTestCase
):
class
TestValidation
(
PostgreSQLTestCase
):
def
test_unbounded
(
self
):
field
=
ArrayField
(
models
.
IntegerField
())
...
...
@@ -345,7 +345,7 @@ class TestValidation(PostgresSQLTestCase):
self
.
assertEqual
(
cm
.
exception
.
messages
[
0
],
'Item 0 in the array did not validate: Ensure this value is greater than or equal to 1.'
)
class
TestSimpleFormField
(
Postgre
s
SQLTestCase
):
class
TestSimpleFormField
(
PostgreSQLTestCase
):
def
test_valid
(
self
):
field
=
SimpleArrayField
(
forms
.
CharField
())
...
...
@@ -417,7 +417,7 @@ class TestSimpleFormField(PostgresSQLTestCase):
self
.
assertEqual
(
form_field
.
max_length
,
4
)
class
TestSplitFormField
(
Postgre
s
SQLTestCase
):
class
TestSplitFormField
(
PostgreSQLTestCase
):
def
test_valid
(
self
):
class
SplitForm
(
forms
.
Form
):
...
...
tests/postgres_tests/test_hstore.py
Dosyayı görüntüle @
00e8e514
...
...
@@ -3,7 +3,7 @@ import json
from
django.core
import
exceptions
,
serializers
from
django.forms
import
Form
from
.
import
Postgre
s
SQLTestCase
from
.
import
PostgreSQLTestCase
from
.models
import
HStoreModel
try
:
...
...
@@ -14,7 +14,7 @@ except ImportError:
pass
class
SimpleTests
(
Postgre
s
SQLTestCase
):
class
SimpleTests
(
PostgreSQLTestCase
):
apps
=
[
'django.contrib.postgres'
]
def
test_save_load_success
(
self
):
...
...
@@ -38,7 +38,7 @@ class SimpleTests(PostgresSQLTestCase):
self
.
assertEqual
(
reloaded
.
field
,
value
)
class
TestQuerying
(
Postgre
s
SQLTestCase
):
class
TestQuerying
(
PostgreSQLTestCase
):
def
setUp
(
self
):
self
.
objs
=
[
...
...
@@ -133,7 +133,7 @@ class TestQuerying(PostgresSQLTestCase):
)
class
TestSerialization
(
Postgre
s
SQLTestCase
):
class
TestSerialization
(
PostgreSQLTestCase
):
test_data
=
'[{"fields": {"field": "{
\\
"a
\\
":
\\
"b
\\
"}"}, "model": "postgres_tests.hstoremodel", "pk": null}]'
def
test_dumping
(
self
):
...
...
@@ -146,7 +146,7 @@ class TestSerialization(PostgresSQLTestCase):
self
.
assertEqual
(
instance
.
field
,
{
'a'
:
'b'
})
class
TestValidation
(
Postgre
s
SQLTestCase
):
class
TestValidation
(
PostgreSQLTestCase
):
def
test_not_a_string
(
self
):
field
=
HStoreField
()
...
...
@@ -156,7 +156,7 @@ class TestValidation(PostgresSQLTestCase):
self
.
assertEqual
(
cm
.
exception
.
message
%
cm
.
exception
.
params
,
'The value of "a" is not a string.'
)
class
TestFormField
(
Postgre
s
SQLTestCase
):
class
TestFormField
(
PostgreSQLTestCase
):
def
test_valid
(
self
):
field
=
forms
.
HStoreField
()
...
...
@@ -192,7 +192,7 @@ class TestFormField(PostgresSQLTestCase):
self
.
assertFalse
(
form_w_hstore
.
has_changed
())
class
TestValidator
(
Postgre
s
SQLTestCase
):
class
TestValidator
(
PostgreSQLTestCase
):
def
test_simple_valid
(
self
):
validator
=
KeysValidator
(
keys
=
[
'a'
,
'b'
])
...
...
tests/postgres_tests/test_json.py
Dosyayı görüntüle @
00e8e514
...
...
@@ -5,7 +5,7 @@ from django.core import exceptions, serializers
from
django.db
import
connection
from
django.test
import
TestCase
from
.
import
Postgre
s
SQLTestCase
from
.
import
PostgreSQLTestCase
from
.models
import
JSONModel
try
:
...
...
@@ -219,7 +219,7 @@ class TestSerialization(TestCase):
self
.
assertEqual
(
instance
.
field
,
{
'a'
:
'b'
})
class
TestValidation
(
Postgre
s
SQLTestCase
):
class
TestValidation
(
PostgreSQLTestCase
):
def
test_not_serializable
(
self
):
field
=
JSONField
()
...
...
@@ -229,7 +229,7 @@ class TestValidation(PostgresSQLTestCase):
self
.
assertEqual
(
cm
.
exception
.
message
%
cm
.
exception
.
params
,
"Value must be valid JSON."
)
class
TestFormField
(
Postgre
s
SQLTestCase
):
class
TestFormField
(
PostgreSQLTestCase
):
def
test_valid
(
self
):
field
=
forms
.
JSONField
()
...
...
tests/postgres_tests/test_ranges.py
Dosyayı görüntüle @
00e8e514
...
...
@@ -8,7 +8,7 @@ from django.db import connection
from
django.test
import
TestCase
,
override_settings
from
django.utils
import
timezone
from
.
import
Postgre
s
SQLTestCase
from
.
import
PostgreSQLTestCase
from
.models
import
RangesModel
try
:
...
...
@@ -222,7 +222,7 @@ class TestSerialization(TestCase):
self
.
assertEqual
(
instance
.
dates
,
None
)
class
TestValidators
(
Postgre
s
SQLTestCase
):
class
TestValidators
(
PostgreSQLTestCase
):
def
test_max
(
self
):
validator
=
RangeMaxValueValidator
(
5
)
...
...
@@ -241,7 +241,7 @@ class TestValidators(PostgresSQLTestCase):
self
.
assertEqual
(
cm
.
exception
.
code
,
'min_value'
)
class
TestFormField
(
Postgre
s
SQLTestCase
):
class
TestFormField
(
PostgreSQLTestCase
):
def
test_valid_integer
(
self
):
field
=
pg_forms
.
IntegerRangeField
()
...
...
@@ -508,7 +508,7 @@ class TestFormField(PostgresSQLTestCase):
self
.
assertIsInstance
(
form_field
,
pg_forms
.
DateTimeRangeField
)
class
TestWidget
(
Postgre
s
SQLTestCase
):
class
TestWidget
(
PostgreSQLTestCase
):
def
test_range_widget
(
self
):
f
=
pg_forms
.
ranges
.
DateTimeRangeField
()
self
.
assertHTMLEqual
(
...
...
tests/postgres_tests/test_unaccent.py
Dosyayı görüntüle @
00e8e514
...
...
@@ -3,12 +3,12 @@ from __future__ import unicode_literals
from
django.test
import
modify_settings
from
.
import
Postgre
s
SQLTestCase
from
.
import
PostgreSQLTestCase
from
.models
import
CharFieldModel
,
TextFieldModel
@modify_settings
(
INSTALLED_APPS
=
{
'append'
:
'django.contrib.postgres'
})
class
UnaccentTest
(
Postgre
s
SQLTestCase
):
class
UnaccentTest
(
PostgreSQLTestCase
):
Model
=
CharFieldModel
...
...
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