summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-04-20 13:08:04 -0400
committerTim Graham <timograham@gmail.com>2014-04-20 13:09:12 -0400
commit9e86c3f0a62a33a541b0ccf7d86a3db87e8e8705 (patch)
treebb58c67406531bf6952aff3028061fed7e9b8bd6
parent0086c9eb48101b6dabefa7f9195ac7d197780f09 (diff)
[1.7.x] Fixed flake8 errors.
Backport of 471fb04a30 from master
-rw-r--r--django/db/migrations/migration.py1
-rw-r--r--tests/migrations/test_autodetector.py4
-rw-r--r--tests/migrations/test_state.py3
3 files changed, 6 insertions, 2 deletions
diff --git a/django/db/migrations/migration.py b/django/db/migrations/migration.py
index e9af9cd994..4ebaa431ba 100644
--- a/django/db/migrations/migration.py
+++ b/django/db/migrations/migration.py
@@ -129,6 +129,7 @@ class Migration(object):
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.
diff --git a/tests/migrations/test_autodetector.py b/tests/migrations/test_autodetector.py
index b033ed424f..2b8e940c4e 100644
--- a/tests/migrations/test_autodetector.py
+++ b/tests/migrations/test_autodetector.py
@@ -581,7 +581,7 @@ class AutodetectorTests(TestCase):
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 @@ class AutodetectorTests(TestCase):
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?
diff --git a/tests/migrations/test_state.py b/tests/migrations/test_state.py
index 1c0224ad52..8e55df6be7 100644
--- a/tests/migrations/test_state.py
+++ b/tests/migrations/test_state.py
@@ -297,18 +297,21 @@ class StateTests(TestCase):
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