22๐
โ
Iโve found the problem.
Instead of manually creating the factory:
created_by = UserFactory()
I have to use the SubFactory
created_by = factory.SubFactory(UserFactory)
๐คEv.
Source:stackexchange.com