mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed E128 flake8 warnings in tests/.
This commit is contained in:
parent
df8d8d4292
commit
92053acbb9
148 changed files with 2073 additions and 2248 deletions
|
@ -267,8 +267,7 @@ class FieldNamesTests(SimpleTestCase):
|
|||
|
||||
max_column_name_length, column_limit_db_alias = get_max_column_name_length()
|
||||
|
||||
@unittest.skipIf(max_column_name_length is None,
|
||||
"The database doesn't have a column name length limit.")
|
||||
@unittest.skipIf(max_column_name_length is None, "The database doesn't have a column name length limit.")
|
||||
def test_M2M_long_column_name(self):
|
||||
"""
|
||||
#13711 -- Model check for long M2M column names when database has
|
||||
|
@ -333,8 +332,8 @@ class FieldNamesTests(SimpleTestCase):
|
|||
'Autogenerated column name too long for M2M field "%s". '
|
||||
'Maximum length is "%s" for database "%s".'
|
||||
% (m2m_long_name, self.max_column_name_length, self.column_limit_db_alias),
|
||||
hint=("Use 'through' to create a separate model for "
|
||||
"M2M and then set column_name using 'db_column'."),
|
||||
hint="Use 'through' to create a separate model for "
|
||||
"M2M and then set column_name using 'db_column'.",
|
||||
obj=ModelWithLongField,
|
||||
id='models.E019',
|
||||
)
|
||||
|
@ -350,8 +349,8 @@ class FieldNamesTests(SimpleTestCase):
|
|||
'Autogenerated column name too long for M2M field "%s_id". '
|
||||
'Maximum length is "%s" for database "%s".'
|
||||
% (long_field_name, self.max_column_name_length, self.column_limit_db_alias),
|
||||
hint=("Use 'through' to create a separate model for "
|
||||
"M2M and then set column_name using 'db_column'."),
|
||||
hint="Use 'through' to create a separate model for "
|
||||
"M2M and then set column_name using 'db_column'.",
|
||||
obj=ModelWithLongField,
|
||||
id='models.E019',
|
||||
)
|
||||
|
@ -359,8 +358,7 @@ class FieldNamesTests(SimpleTestCase):
|
|||
|
||||
self.assertEqual(errors, expected)
|
||||
|
||||
@unittest.skipIf(max_column_name_length is None,
|
||||
"The database doesn't have a column name length limit.")
|
||||
@unittest.skipIf(max_column_name_length is None, "The database doesn't have a column name length limit.")
|
||||
def test_local_field_long_column_name(self):
|
||||
"""
|
||||
#13711 -- Model check for long column names
|
||||
|
@ -724,10 +722,8 @@ class OtherModelTests(SimpleTestCase):
|
|||
pass
|
||||
|
||||
class Group(models.Model):
|
||||
primary = models.ManyToManyField(Person,
|
||||
through="Membership", related_name="primary")
|
||||
secondary = models.ManyToManyField(Person, through="Membership",
|
||||
related_name="secondary")
|
||||
primary = models.ManyToManyField(Person, through="Membership", related_name="primary")
|
||||
secondary = models.ManyToManyField(Person, through="Membership", related_name="secondary")
|
||||
|
||||
class Membership(models.Model):
|
||||
person = models.ForeignKey(Person, models.CASCADE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue