Replies: 1 comment
-
Hey @AsgerJ95, you can set hard coded inputs by setting a field with the same name on the factory class. The relevant docs are here. For this specific use case, I would recommend using Let me know if that works for you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When using ModelFactory for testing purposes model_validators return an error due to the random values.
Is it possible to hard code certain BaseModels similar to what is described in 1.4.1 (Old) polyfactory doc., but without the assert from model_validators?
It seems like the it generates random values and then overwrites it with the hard coded input. Which will still return the assert.
Old documentation: [https://pypi.org/project/pydantic-factories/1.4.1/]
Example:
When using polyfactory - ModelFactory for generating random values for testing, the PeriodBase class the model_validator,
In this case a bunch of schedules should be hardcoded, but the model_validator will still return the assert.
Beta Was this translation helpful? Give feedback.
All reactions