Fixed flake8 errors.
This commit is contained in:
parent
bbe818b23c
commit
471fb04a30
|
@ -129,6 +129,7 @@ class Migration(object):
|
||||||
operation.database_backwards(self.app_label, schema_editor, from_state, to_state)
|
operation.database_backwards(self.app_label, schema_editor, from_state, to_state)
|
||||||
return project_state
|
return project_state
|
||||||
|
|
||||||
|
|
||||||
def swappable_dependency(value):
|
def swappable_dependency(value):
|
||||||
"""
|
"""
|
||||||
Turns a setting value into a dependency.
|
Turns a setting value into a dependency.
|
||||||
|
|
|
@ -581,7 +581,7 @@ class AutodetectorTests(TestCase):
|
||||||
the FK field before the model to maintain consistency.
|
the FK field before the model to maintain consistency.
|
||||||
"""
|
"""
|
||||||
before = self.make_project_state([self.author_with_publisher, self.publisher])
|
before = self.make_project_state([self.author_with_publisher, self.publisher])
|
||||||
after = self.make_project_state([self.author_name]) # removes both the model and FK
|
after = self.make_project_state([self.author_name]) # removes both the model and FK
|
||||||
autodetector = MigrationAutodetector(before, after)
|
autodetector = MigrationAutodetector(before, after)
|
||||||
changes = autodetector._detect_changes()
|
changes = autodetector._detect_changes()
|
||||||
# Right number of migrations?
|
# Right number of migrations?
|
||||||
|
@ -603,7 +603,7 @@ class AutodetectorTests(TestCase):
|
||||||
the field before the model to maintain consistency.
|
the field before the model to maintain consistency.
|
||||||
"""
|
"""
|
||||||
before = self.make_project_state([self.book_with_multiple_authors_through_attribution, self.author_name, self.attribution])
|
before = self.make_project_state([self.book_with_multiple_authors_through_attribution, self.author_name, self.attribution])
|
||||||
after = self.make_project_state([self.book_with_no_author, self.author_name]) # removes both the through model and ManyToMany
|
after = self.make_project_state([self.book_with_no_author, self.author_name]) # removes both the through model and ManyToMany
|
||||||
autodetector = MigrationAutodetector(before, after)
|
autodetector = MigrationAutodetector(before, after)
|
||||||
changes = autodetector._detect_changes()
|
changes = autodetector._detect_changes()
|
||||||
# Right number of migrations?
|
# Right number of migrations?
|
||||||
|
|
|
@ -297,18 +297,21 @@ class StateTests(TestCase):
|
||||||
|
|
||||||
class Author(models.Model):
|
class Author(models.Model):
|
||||||
name = models.TextField()
|
name = models.TextField()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = "migrations"
|
app_label = "migrations"
|
||||||
apps = new_apps
|
apps = new_apps
|
||||||
|
|
||||||
class Book(models.Model):
|
class Book(models.Model):
|
||||||
author = models.ForeignKey(Author)
|
author = models.ForeignKey(Author)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = "migrations"
|
app_label = "migrations"
|
||||||
apps = new_apps
|
apps = new_apps
|
||||||
|
|
||||||
class Magazine(models.Model):
|
class Magazine(models.Model):
|
||||||
authors = models.ManyToManyField(Author)
|
authors = models.ManyToManyField(Author)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
app_label = "migrations"
|
app_label = "migrations"
|
||||||
apps = new_apps
|
apps = new_apps
|
||||||
|
|
Loading…
Reference in New Issue