summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2020-06-01 20:18:14 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-06-04 08:27:46 +0200
commite24b63fe859c03c429ebeb7d28665f591cee22ff (patch)
treea6749884b93c01aa0c4e311535bded8d35dbba04 /tests
parente198beadad56d5fdd06756b097446b7046a84010 (diff)
Refs #31630 -- Removed DatabaseFeatures.can_introspect_autofield.
Diffstat (limited to 'tests')
-rw-r--r--tests/inspectdb/tests.py5
-rw-r--r--tests/introspection/tests.py4
2 files changed, 4 insertions, 5 deletions
diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py
index 7ed96abd37..583512cc09 100644
--- a/tests/inspectdb/tests.py
+++ b/tests/inspectdb/tests.py
@@ -99,8 +99,9 @@ class InspectDBTestCase(TestCase):
assertFieldType = self.make_field_type_asserter()
introspected_field_types = connection.features.introspected_field_types
- if not connection.features.can_introspect_autofield:
- assertFieldType('id', "models.IntegerField(primary_key=True) # AutoField?")
+ auto_field_type = connection.features.introspected_field_types['AutoField']
+ if auto_field_type != 'AutoField':
+ assertFieldType('id', "models.%s(primary_key=True) # AutoField?" % auto_field_type)
assertFieldType('big_int_field', 'models.%s()' % introspected_field_types['BigIntegerField'])
diff --git a/tests/introspection/tests.py b/tests/introspection/tests.py
index 8ca5c3af3b..9335250c89 100644
--- a/tests/introspection/tests.py
+++ b/tests/introspection/tests.py
@@ -80,7 +80,7 @@ class IntrospectionTests(TransactionTestCase):
self.assertEqual(
[connection.introspection.get_field_type(r[1], r) for r in desc],
[
- 'AutoField' if connection.features.can_introspect_autofield else 'IntegerField',
+ connection.features.introspected_field_types['AutoField'],
'CharField',
'CharField',
'CharField',
@@ -108,7 +108,6 @@ class IntrospectionTests(TransactionTestCase):
[False, nullable_by_backend, nullable_by_backend, nullable_by_backend, True, True, False, False]
)
- @skipUnlessDBFeature('can_introspect_autofield')
def test_bigautofield(self):
with connection.cursor() as cursor:
desc = connection.introspection.get_table_description(cursor, City._meta.db_table)
@@ -117,7 +116,6 @@ class IntrospectionTests(TransactionTestCase):
[connection.introspection.get_field_type(r[1], r) for r in desc],
)
- @skipUnlessDBFeature('can_introspect_autofield')
def test_smallautofield(self):
with connection.cursor() as cursor:
desc = connection.introspection.get_table_description(cursor, Country._meta.db_table)