Browse files

[1.7.x] Fixed flake8 errors.

Backport of 471fb04 from master
  • Loading branch information...
1 parent 0086c9e commit 9e86c3f0a62a33a541b0ccf7d86a3db87e8e8705 @timgraham timgraham committed Apr 20, 2014
Showing with 6 additions and 2 deletions.
  1. +1 −0 django/db/migrations/migration.py
  2. +2 −2 tests/migrations/test_autodetector.py
  3. +3 −0 tests/migrations/test_state.py
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

0 comments on commit 9e86c3f

Please sign in to comment.