From 8fbd74a2f0b8cf76c8c7a09b9487639cb560cf9f Mon Sep 17 00:00:00 2001 From: Joshua Munn Date: Sun, 6 Oct 2024 11:07:12 +0100 Subject: [PATCH] Rename operations_and_block_path identifiers for consistency --- wagtail/test/streamfield_migrations/testutils.py | 8 ++++---- .../streamfield_migrations/test_migration_names.py | 12 ++++++------ .../tests/streamfield_migrations/test_migrations.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/wagtail/test/streamfield_migrations/testutils.py b/wagtail/test/streamfield_migrations/testutils.py index 744223fabe..9a22140e10 100644 --- a/wagtail/test/streamfield_migrations/testutils.py +++ b/wagtail/test/streamfield_migrations/testutils.py @@ -10,7 +10,7 @@ class MigrationTestMixin: default_operation_and_block_path = [] app_name = None - def init_migration(self, revisions_from=None, operations_and_block_path=None): + def init_migration(self, revisions_from=None, operations_and_block_paths=None): migration = Migration( "test_migration", "wagtail_streamfield_migration_toolkit_test" ) @@ -18,7 +18,7 @@ class MigrationTestMixin: app_name=self.app_name, model_name=self.model.__name__, field_name="content", - operations_and_block_paths=operations_and_block_path + operations_and_block_paths=operations_and_block_paths or self.default_operation_and_block_path, revisions_from=revisions_from, ) @@ -29,11 +29,11 @@ class MigrationTestMixin: def apply_migration( self, revisions_from=None, - operations_and_block_path=None, + operations_and_block_paths=None, ): migration = self.init_migration( revisions_from=revisions_from, - operations_and_block_path=operations_and_block_path, + operations_and_block_paths=operations_and_block_paths, ) loader = MigrationLoader(connection=connection) diff --git a/wagtail/tests/streamfield_migrations/test_migration_names.py b/wagtail/tests/streamfield_migrations/test_migration_names.py index ad81f7c891..4abf0e6b61 100644 --- a/wagtail/tests/streamfield_migrations/test_migration_names.py +++ b/wagtail/tests/streamfield_migrations/test_migration_names.py @@ -13,35 +13,35 @@ class MigrationNameTest(TestCase, MigrationTestMixin): app_name = "wagtail_streamfield_migration_toolkit_test" def test_rename(self): - operations_and_block_path = [ + operations_and_block_paths = [ ( RenameStreamChildrenOperation(old_name="char1", new_name="renamed1"), "", ) ] migration = self.init_migration( - operations_and_block_path=operations_and_block_path + operations_and_block_paths=operations_and_block_paths ) suggested_name = migration.suggest_name() self.assertEqual(suggested_name, "rename_char1_to_renamed1") def test_remove(self): - operations_and_block_path = [ + operations_and_block_paths = [ ( RemoveStreamChildrenOperation(name="char1"), "", ) ] migration = self.init_migration( - operations_and_block_path=operations_and_block_path + operations_and_block_paths=operations_and_block_paths ) suggested_name = migration.suggest_name() self.assertEqual(suggested_name, "remove_char1") def test_multiple(self): - operations_and_block_path = [ + operations_and_block_paths = [ ( RenameStreamChildrenOperation(old_name="char1", new_name="renamed1"), "", @@ -52,7 +52,7 @@ class MigrationNameTest(TestCase, MigrationTestMixin): ), ] migration = self.init_migration( - operations_and_block_path=operations_and_block_path + operations_and_block_paths=operations_and_block_paths ) suggested_name = migration.suggest_name() diff --git a/wagtail/tests/streamfield_migrations/test_migrations.py b/wagtail/tests/streamfield_migrations/test_migrations.py index 144f3a3356..01725de7ba 100644 --- a/wagtail/tests/streamfield_migrations/test_migrations.py +++ b/wagtail/tests/streamfield_migrations/test_migrations.py @@ -278,7 +278,7 @@ class StreamChildrenToListBlockOperationTestCase(BaseMigrationTest): """ self.apply_migration( - operations_and_block_path=[ + operations_and_block_paths=[ ( StreamChildrenToListBlockOperation( block_name="char1", list_block_name="list1"