diff --git a/src/wagtail_factories/blocks.py b/src/wagtail_factories/blocks.py index 5a78416..3e44758 100644 --- a/src/wagtail_factories/blocks.py +++ b/src/wagtail_factories/blocks.py @@ -86,7 +86,7 @@ class StreamFieldFactory(ParameteredAttribute): """ - def __init__(self, block_types, defaults: Optional[dict]=None): + def __init__(self, block_types, defaults: Optional[dict] = None): super().__init__(**(defaults or {})) if isinstance(block_types, dict): # Old style definition, dict mapping block name -> block factory diff --git a/src/wagtail_factories/factories.py b/src/wagtail_factories/factories.py index 7b8e681..4f9bd73 100644 --- a/src/wagtail_factories/factories.py +++ b/src/wagtail_factories/factories.py @@ -84,7 +84,9 @@ def _get_or_create(cls, model_class, *args, **kwargs): if field not in kwargs: raise errors.FactoryError( "django_get_or_create - " - "Unable to find initialization value for '{}' in factory {}".format(field, cls.__name__) + "Unable to find initialization value for '{}' in factory {}".format( + field, cls.__name__ + ) ) lookup_fields[field] = kwargs[field] diff --git a/tests/test_stream_block.py b/tests/test_stream_block.py index ebbcc19..3eddb7c 100644 --- a/tests/test_stream_block.py +++ b/tests/test_stream_block.py @@ -81,7 +81,10 @@ def test_page_with_deeply_nested_stream_block_defaults(self): assert page.body[0].value["inner_stream"][0].value is None assert page.body[1].value["inner_stream"][0].block_type == "struct_block" - assert page.body[1].value["inner_stream"][0].value["title"] == "lazy function foobar" + assert ( + page.body[1].value["inner_stream"][0].value["title"] + == "lazy function foobar" + ) def test_page_with_deeply_nested_stream_block_in_list_block(self): page = PageWithStreamBlockInListBlockFactory( @@ -96,7 +99,9 @@ def test_computed_values_on_struct_block_in_nested_stream(self): ) assert page.body[0].value[0].value["boolean"] is True assert page.body[0].value[0].value["text"][:4] == "True" - assert page.body[0].value[0].value["text"][4:] == str(page.body[0].value[0].value["number"]) + assert page.body[0].value[0].value["text"][4:] == str( + page.body[0].value[0].value["number"] + ) def test_factory_with_anonymous_stream_block_in_tree(self): # The inner_stream child block is defined as an "anonymous" StreamBlock (i.e. declared