Every example of factories I’ve seen so far seems to use the Repo directly to insert data into the database.
I was just thinking, why is that the case? If you are using it for tests, wouldn’t you want to ensure that the data you are testing is formatted in the same way it’s used in the application, i.e. going through the context functions?
It seems to me that by using the repo directly you are susceptible to mess things up by inserting data that would never be persisted in the real application flow cause it would be stopped in changeset checks and such.
Am I missing something?
Thanks!