mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Appeased flake8.
This commit is contained in:
@@ -757,10 +757,12 @@ class OperationTests(MigrationTestBase):
|
||||
Tests the RunPython operation correctly handles the "atomic" keyword
|
||||
"""
|
||||
project_state = self.set_up_test_model("test_runpythonatomic", mti_model=True)
|
||||
|
||||
def inner_method(models, schema_editor):
|
||||
Pony = models.get_model("test_runpythonatomic", "Pony")
|
||||
Pony.objects.create(pink=1, weight=3.55)
|
||||
raise ValueError("Adrian hates ponies.")
|
||||
|
||||
atomic_migration = Migration("test", "test_runpythonatomic")
|
||||
atomic_migration.operations = [migrations.RunPython(inner_method)]
|
||||
non_atomic_migration = Migration("test", "test_runpythonatomic")
|
||||
@@ -789,7 +791,6 @@ class OperationTests(MigrationTestBase):
|
||||
self.assertEqual(project_state.render().get_model("test_runpythonatomic", "Pony").objects.count(), 1)
|
||||
|
||||
|
||||
|
||||
class MigrateNothingRouter(object):
|
||||
"""
|
||||
A router that sends all writes to the other database.
|
||||
|
||||
Reference in New Issue
Block a user