3👍
✅
I am not sure if you can do that in factory
. But you can do it in a single line with model_mommy
Install model_mommy.
$ pip install model_mommy
Create a dummy model.
from model_mommy import mommy
from your_app.models import ShippingContainer
dummy_shipping_container = mommy.make('ShippingContainer')
Source:stackexchange.com