GoTop
GoTop

Reputation: 901

Can Factory Boy auto generate Django model field values like Model Mommy does?

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?

Upvotes: 11

Views: 1687

Answers (1)

Oin
Oin

Reputation: 7529

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.

Upvotes: 11

Related Questions