-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with Maybe / Trait when defined in Params #126
Comments
I'm still facing this issue:
Debugging info:
Versions in my environment:
|
I also encountered the same event. The factory I defined is the one that contains the RelatedFactory in the Trait. as follows: import factory
class UserFactory(factory.Factory):
class Meta:
model = User
id = 1
class BookFactory(factory.Factory):
class Meta:
model = Book
class Params:
user_r = factory.Trait(
users=factory.RelatedFactoryList("factories.UserFactory"),
factory_related_name="id",
size=10,
)
name = "book name" I am not sure about the details of the implementation, but it worked locally by modifying the conditional expression for the decl object in the following location.
if isinstance(decl, (factory.RelatedFactory, factory.Maybe)): If the corrections above are sufficient to address the issue, then please fix it! |
It's really hard to properly handle
If you have any idea how to add support for |
Especially with FactoryBoy 3.2. See failing tests in #125
The text was updated successfully, but these errors were encountered: