litestar-org / polyfactory

Simple and powerful factories for mock data generation
https://polyfactory.litestar.dev/
MIT License
1.05k stars 81 forks source link

Bug: factories created as part of nested models do not inherit class attributes #426

Closed guacs closed 9 months ago

guacs commented 1 year ago

Description

If there's a nested model that a factory is available for, then a factory for that model is dynamically created. This dynamically created factory does not inherit from the original factory.

This is the root cause for the following issues:

URL to code causing the issue

No response

MCVE

# Your MCVE code here

Steps to reproduce

No response

Screenshots

No response

Logs

No response

Release Version

2.10.0

Platform


[!NOTE]
While we are open for sponsoring on GitHub Sponsors and OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh Litestar dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.

Fund with Polar