Validator doesn't work while creating factories?

I am creating a factory object in tests for a model which has defined route validators,
the factory object does not raise error, if while creation any validation is not fulfilled.
Is that a expected behaviour ?

1 Like

I am sorry to say, this doesn’t answer my question, my question is not if one should write tests or not.
Its regarding if the framework offers the ability to validate factory objects while creation.

1 Like

I do not see the relation between validators and factories.
Factories are there for seeding directly the database, without passing through HTTP requests, thus validators are meaningless to factories and they do not have an effect on them.

1 Like

used validation as hooks to get the same done, instead of route validators.

1 Like

Factories generate data randomly. Personally I do not see the interest in setting rules and limits to this randomness (which anyway respects the intent, that is a floating() generates a float, age() generates an integer …ect) as the final purpose is to seed the database.