Open m4ra opened 2 months ago
@rjlanari is this something you would like to work on? The two first items describe the solution inside the quoted text by pointing the file that needs to be edited and what should be changed. So those two fixes are relative easy.
The rest of the items that have to do with factories need some changes in their related fields (ForeignKey field of a Model).
Factories are a method to create data and populate the testing database.
The Topic and Project models are related. See class Topic
and class Project
here.
So their respective factories TopicFactory and ProjectFactory need to be related too.
Same with the User and Organisation factories.
All these factories are bundled in this file. The relation is marked with a SubFactory
How to handle relations in factories has changed in the current version of the factory package. Thus why we receive these warnings. How to do subfactories from now on, it is explained here.
However if you haven't looked into Django model relations before, I suggest you start from here, before looking into factories.
Have a look and see how far you can go with this.
A list of items that need to be fixed from the warnings we get when we run the tests from the root directory:
tests/projects/test_project_models.py::test_delete_project