factory_boy
factory_boy copied to clipboard
Support Django 4.1 Asynchronous ORM interface
To instantiate a Django's models with factory_boy
within an async context, we currently need to wrap it with sync_to_async
, e.g. workspace = await sync_to_async(WorkspaceFactory)()
.
It would be awesome if DjangoModelFactory
could provide a .acreate()
method, which either encapsulates the call to sync_to_async
or even better, uses the new Asynchronous ORM interface
from Django 4.1.
The latter would automatically benefit from any future development of Django's async ORM.