Trying to use deeply nested arguments to ListBlock items via ListBlockFactory results in the following error:
...
File "/venv/lib/python3.8/site-packages/wagtail_factories/blocks.py", line 81, in generate
prefix, label = key.split("__", 2)
ValueError: too many values to unpack (expected 2)
This happens if your list block item factories themselves contain SubFactory declarations:
class ListItemFactory(wagtail_factories.StructBlockFactory):
class Meta:
model = ListItem
some_fk = factory.SubFactory(MyOtherModelFactory)
Trying to use deeply nested arguments to
ListBlock
items viaListBlockFactory
results in the following error:This happens if your list block item factories themselves contain
SubFactory
declarations:Then this sort of thing fails:
I'm pretty sure that the
2
passed tostr.split
here should be a1
: https://github.com/wagtail/wagtail-factories/blob/d4fcf1d84f2ee5feaa63d974df44ae7b0626ee27/src/wagtail_factories/blocks.py#L82