summaryrefslogtreecommitdiff
path: root/tests/inspectdb
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-04 08:08:27 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit7119f40c9881666b6f9b5cf7df09ee1d21cc8344 (patch)
treefa50869f5614295f462d9bf77fec59365c621609 /tests/inspectdb
parent9c19aff7c7561e3a82978a272ecdaad40dda5c00 (diff)
downloaddjango-7119f40c9881666b6f9b5cf7df09ee1d21cc8344.tar.gz
Refs #33476 -- Refactored code to strictly match 88 characters line length.
Diffstat (limited to 'tests/inspectdb')
-rw-r--r--tests/inspectdb/tests.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/inspectdb/tests.py b/tests/inspectdb/tests.py
index 83dbfd406d..53c7ce9013 100644
--- a/tests/inspectdb/tests.py
+++ b/tests/inspectdb/tests.py
@@ -57,7 +57,10 @@ class InspectDBTestCase(TestCase):
self.assertNotIn("InspectdbPeopledata", output)
def make_field_type_asserter(self):
- """Call inspectdb and return a function to validate a field type in its output"""
+ """
+ Call inspectdb and return a function to validate a field type in its
+ output.
+ """
out = StringIO()
call_command("inspectdb", "inspectdb_columntypes", stdout=out)
output = out.getvalue()
@@ -233,13 +236,16 @@ class InspectDBTestCase(TestCase):
output,
msg=error_message,
)
- # As InspectdbPeople model is defined after InspectdbMessage, it should be quoted
+ # As InspectdbPeople model is defined after InspectdbMessage, it should
+ # be quoted.
self.assertIn(
- "from_field = models.ForeignKey('InspectdbPeople', models.DO_NOTHING, db_column='from_id')",
+ "from_field = models.ForeignKey('InspectdbPeople', models.DO_NOTHING, "
+ "db_column='from_id')",
output,
)
self.assertIn(
- "people_pk = models.OneToOneField(InspectdbPeople, models.DO_NOTHING, primary_key=True)",
+ "people_pk = models.OneToOneField(InspectdbPeople, models.DO_NOTHING, "
+ "primary_key=True)",
output,
)
self.assertIn(
@@ -325,7 +331,9 @@ class InspectDBTestCase(TestCase):
self.assertIn("class InspectdbSpecialTableName(models.Model):", output)
def test_managed_models(self):
- """By default the command generates models with `Meta.managed = False` (#14305)"""
+ """
+ By default the command generates models with `Meta.managed = False`.
+ """
out = StringIO()
call_command("inspectdb", "inspectdb_columntypes", stdout=out)
output = out.getvalue()
@@ -390,7 +398,8 @@ class InspectDBTestCase(TestCase):
"""
out = StringIO()
with mock.patch(
- "django.db.connection.introspection.data_types_reverse.base_data_types_reverse",
+ "django.db.connection.introspection.data_types_reverse."
+ "base_data_types_reverse",
{
"text": "myfields.TextField",
"bigint": "BigIntegerField",