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
cc0bb070
Kaydet (Commit)
cc0bb070
authored
Ara 19, 2016
tarafından
Mariusz Felisiak
Kaydeden (comit)
Tim Graham
Ara 19, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #19884 -- Removed DatabaseFeatures.can_introspect_max_length.
Unused (always True) after
3e43d24a
.
üst
10278885
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
22 deletions
+8
-22
features.py
django/db/backends/base/features.py
+0
-3
tests.py
tests/inspectdb/tests.py
+8
-18
tests.py
tests/introspection/tests.py
+0
-1
No files found.
django/db/backends/base/features.py
Dosyayı görüntüle @
cc0bb070
...
...
@@ -116,9 +116,6 @@ class BaseDatabaseFeatures(object):
# Does the backend reset sequences between tests?
supports_sequence_reset
=
True
# Can the backend determine reliably the length of a CharField?
can_introspect_max_length
=
True
# Can the backend determine reliably if a field is nullable?
# Note that this is separate from interprets_empty_strings_as_nulls,
# although the latter feature, when true, interferes with correct
...
...
tests/inspectdb/tests.py
Dosyayı görüntüle @
cc0bb070
...
...
@@ -59,37 +59,27 @@ class InspectDBTestCase(TestCase):
# Inspecting Oracle DB doesn't produce correct results (#19884):
# - it reports fields as blank=True when they aren't.
if
(
connection
.
features
.
can_introspect_max_length
and
not
connection
.
features
.
interprets_empty_strings_as_nulls
):
if
not
connection
.
features
.
interprets_empty_strings_as_nulls
:
assertFieldType
(
'char_field'
,
"models.CharField(max_length=10)"
)
assertFieldType
(
'null_char_field'
,
"models.CharField(max_length=10, blank=True, null=True)"
)
assertFieldType
(
'comma_separated_int_field'
,
"models.CharField(max_length=99)"
)
assertFieldType
(
'date_field'
,
"models.DateField()"
)
assertFieldType
(
'date_time_field'
,
"models.DateTimeField()"
)
if
(
connection
.
features
.
can_introspect_max_length
and
not
connection
.
features
.
interprets_empty_strings_as_nulls
):
assertFieldType
(
'email_field'
,
"models.CharField(max_length=254)"
)
assertFieldType
(
'file_field'
,
"models.CharField(max_length=100)"
)
assertFieldType
(
'file_path_field'
,
"models.CharField(max_length=100)"
)
assertFieldType
(
'slug_field'
,
"models.CharField(max_length=50)"
)
assertFieldType
(
'text_field'
,
"models.TextField()"
)
assertFieldType
(
'url_field'
,
"models.CharField(max_length=200)"
)
assertFieldType
(
'date_field'
,
"models.DateField()"
)
assertFieldType
(
'date_time_field'
,
"models.DateTimeField()"
)
if
connection
.
features
.
can_introspect_ip_address_field
:
assertFieldType
(
'gen_ip_adress_field'
,
"models.GenericIPAddressField()"
)
elif
(
connection
.
features
.
can_introspect_max_length
and
not
connection
.
features
.
interprets_empty_strings_as_nulls
):
elif
not
connection
.
features
.
interprets_empty_strings_as_nulls
:
assertFieldType
(
'gen_ip_adress_field'
,
"models.CharField(max_length=39)"
)
if
(
connection
.
features
.
can_introspect_max_length
and
not
connection
.
features
.
interprets_empty_strings_as_nulls
):
assertFieldType
(
'slug_field'
,
"models.CharField(max_length=50)"
)
if
not
connection
.
features
.
interprets_empty_strings_as_nulls
:
assertFieldType
(
'text_field'
,
"models.TextField()"
)
if
connection
.
features
.
can_introspect_time_field
:
assertFieldType
(
'time_field'
,
"models.TimeField()"
)
if
(
connection
.
features
.
can_introspect_max_length
and
not
connection
.
features
.
interprets_empty_strings_as_nulls
):
assertFieldType
(
'url_field'
,
"models.CharField(max_length=200)"
)
if
connection
.
features
.
has_native_uuid_field
:
assertFieldType
(
'uuid_field'
,
"models.UUIDField()"
)
elif
(
connection
.
features
.
can_introspect_max_length
and
not
connection
.
features
.
interprets_empty_strings_as_nulls
):
elif
not
connection
.
features
.
interprets_empty_strings_as_nulls
:
assertFieldType
(
'uuid_field'
,
"models.CharField(max_length=32)"
)
def
test_number_field_types
(
self
):
...
...
tests/introspection/tests.py
Dosyayı görüntüle @
cc0bb070
...
...
@@ -83,7 +83,6 @@ class IntrospectionTests(TransactionTestCase):
'SmallIntegerField'
if
connection
.
features
.
can_introspect_small_integer_field
else
'IntegerField'
]
)
@skipUnlessDBFeature
(
'can_introspect_max_length'
)
def
test_get_table_description_col_lengths
(
self
):
with
connection
.
cursor
()
as
cursor
:
desc
=
connection
.
introspection
.
get_table_description
(
cursor
,
Reporter
.
_meta
.
db_table
)
...
...
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