factory_boy icon indicating copy to clipboard operation
factory_boy copied to clipboard

Allow breaking circular imports with a lambda

Open glittershark opened this issue 4 years ago • 1 comments

The option to have factory references for related or sub-factories be strings is great, but breaks down if the referenced factory is anything other than a class defined at the top-level of a module - for example, I'm doing some stuff that dynamically defines factory classes and returns them from functions, which I'd like to be able to reference dynamically. This adds support to FactoryWrapper for related factories being callables, in addition to direct classes and strings.

glittershark avatar May 27 '20 15:05 glittershark

@glittershark maybe add some tests showing how it works. You may also add some documentation for the feature

MRigal avatar Nov 02 '20 11:11 MRigal