mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #29870 -- Added DurationField introspection for Oracle and PostgreSQL.
Thanks Tim Graham for the review.
This commit is contained in:
parent
19126339f3
commit
328f5627dd
8 changed files with 26 additions and 6 deletions
|
@ -77,11 +77,16 @@ class IntrospectionTests(TransactionTestCase):
|
|||
desc = connection.introspection.get_table_description(cursor, Reporter._meta.db_table)
|
||||
self.assertEqual(
|
||||
[datatype(r[1], r) for r in desc],
|
||||
['AutoField' if connection.features.can_introspect_autofield else 'IntegerField',
|
||||
'CharField', 'CharField', 'CharField',
|
||||
'BigIntegerField' if connection.features.can_introspect_big_integer_field else 'IntegerField',
|
||||
'BinaryField' if connection.features.can_introspect_binary_field else 'TextField',
|
||||
'SmallIntegerField' if connection.features.can_introspect_small_integer_field else 'IntegerField']
|
||||
[
|
||||
'AutoField' if connection.features.can_introspect_autofield else 'IntegerField',
|
||||
'CharField',
|
||||
'CharField',
|
||||
'CharField',
|
||||
'BigIntegerField' if connection.features.can_introspect_big_integer_field else 'IntegerField',
|
||||
'BinaryField' if connection.features.can_introspect_binary_field else 'TextField',
|
||||
'SmallIntegerField' if connection.features.can_introspect_small_integer_field else 'IntegerField',
|
||||
'DurationField' if connection.features.can_introspect_duration_field else 'BigIntegerField',
|
||||
]
|
||||
)
|
||||
|
||||
def test_get_table_description_col_lengths(self):
|
||||
|
@ -98,7 +103,7 @@ class IntrospectionTests(TransactionTestCase):
|
|||
nullable_by_backend = connection.features.interprets_empty_strings_as_nulls
|
||||
self.assertEqual(
|
||||
[r[6] for r in desc],
|
||||
[False, nullable_by_backend, nullable_by_backend, nullable_by_backend, True, True, False]
|
||||
[False, nullable_by_backend, nullable_by_backend, nullable_by_backend, True, True, False, False]
|
||||
)
|
||||
|
||||
@skipUnlessDBFeature('can_introspect_autofield')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue