Open KevinMind opened 1 month ago
We have wanted to do this in the past (https://github.com/mozilla/addons/issues/5595, and also all the issues about landfill
- which is aptly named, it is absolutely terrible) but never got the bandwidth for it, it's not a trivial task, there are lots of little details that are handled by those factories, and tons of tests depend on it.
I know. Just want a task that won't be burned in the fires of stalebot. I would be so excited if we could get this done.
Also, no reason we would have to do all at once.
It would have been useful for blocked versions recently. We could start with a easy factory like user_factory
, but for the rest if would be much more involved.
Description
I'm regularly frustrated with the cutsom factory methods we have. It's often difficult to understand what arguments to pass, what they do, and how factories relate to each other.
It's not terrible, but there are better options out there. https://factoryboy.readthedocs.io/en/stable/index.html
Let's use factory boy (or something better should it exist) to define our factories. This will make our tests easier to maintain, make it easier to generate test data for verifying PRs and seeding the DB and allow us to unify the way of generating data across the development environment (no more fixtures)
Acceptance Criteria
Checks
┆Issue is synchronized with this Jira Task