Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed flake8 errors.

  • Loading branch information...
commit 471fb04a307870794e3cefb1177405b506ee1a0a 1 parent bbe818b
Tim Graham timgraham authored
1  django/db/migrations/migration.py
View
@@ -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.
4 tests/migrations/test_autodetector.py
View
@@ -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?
3  tests/migrations/test_state.py
View
@@ -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.