Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
RelatedFactory parametrs #58
I took this example RelatedFactory and modified it with the "name" field.
Here is my source code:
This caused the following error:
That's indeed a nasty bug, due to the fact that the second argument to
I'll rename it to "factory_related_name", with deprecation warnings; that might take a couple of releases.
In the meantime, could you see if the following definition works for you:
class UserFactory(factory.DjangoModelFactory): FACTORY_FOR = models.User log = factory.RelatedFactory(UserLogFactory, 'user', action='create') log__name = 'test'