Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.7.x] Fixed flake8 errors.

Backport of 471fb04 from master
  • Loading branch information...
commit 9e86c3f0a62a33a541b0ccf7d86a3db87e8e8705 1 parent 0086c9e
@timgraham timgraham authored
View
1  django/db/migrations/migration.py
@@ -129,6 +129,7 @@ def unapply(self, project_state, schema_editor, collect_sql=False):
operation.database_backwards(self.app_label, schema_editor, from_state, to_state)
return project_state
+
def swappable_dependency(value):
"""
Turns a setting value into a dependency.
View
4 tests/migrations/test_autodetector.py
@@ -581,7 +581,7 @@ def test_foreign_key_removed_before_target_model(self):
the FK field before the model to maintain consistency.
"""
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)
changes = autodetector._detect_changes()
# Right number of migrations?
@@ -603,7 +603,7 @@ def test_many_to_many_removed_before_through_model(self):
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])
- 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)
changes = autodetector._detect_changes()
# Right number of migrations?
View
3  tests/migrations/test_state.py
@@ -297,18 +297,21 @@ def test_dangling_references_throw_error(self):
class Author(models.Model):
name = models.TextField()
+
class Meta:
app_label = "migrations"
apps = new_apps
class Book(models.Model):
author = models.ForeignKey(Author)
+
class Meta:
app_label = "migrations"
apps = new_apps
class Magazine(models.Model):
authors = models.ManyToManyField(Author)
+
class Meta:
app_label = "migrations"
apps = new_apps
Please sign in to comment.
Something went wrong with that request. Please try again.