diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2018-10-21 09:08:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-21 09:08:05 +0200 |
commit | 328f5627ddfca3008dc5cf9f7da1ade0157ac74f (patch) | |
tree | 15e58dc7074e36934bfb13d401e97009642b1d42 /tests/introspection/tests.py | |
parent | 19126339f307e589f99259ab0176c4367a8055f0 (diff) | |
download | django-328f5627ddfca3008dc5cf9f7da1ade0157ac74f.tar.gz |
Fixed #29870 -- Added DurationField introspection for Oracle and PostgreSQL.
Thanks Tim Graham for the review.
Diffstat (limited to 'tests/introspection/tests.py')
-rw-r--r-- | tests/introspection/tests.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/introspection/tests.py b/tests/introspection/tests.py index ed5556fc20..c61720d12b 100644 --- a/tests/introspection/tests.py +++ b/tests/introspection/tests.py @@ -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') |