You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
To instantiate a Django's models with
factory_boy
within an async context, we currently need to wrap it withsync_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 tosync_to_async
or even better, uses the newAsynchronous ORM interface
from Django 4.1.The latter would automatically benefit from any future development of Django's async ORM.
The text was updated successfully, but these errors were encountered: