By using Model Mommy, you don't have to set every Model field you use, Model Mommy will automatically set them for you.
but in Factory Boy, if you want to use some field in the test, you have to explicitly set the value for them in ModelFactory class.
My question is: Can Factory Boy auto generate Model field values like Model Mommy does?
No, Factory Boy does not currently have a way to generate values based on the attribute types defined on the database model without having to define a Factory Boy generator of some sort.
Sounds like a good feature request however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With