Hi,
You can disable a specific post_generation hook by overloading it with another post_generation hook:
@factory.post_generation
def noop(obj, create, extracted, **kwargs):
pass
MyFactory(some_post_gen=noop)
Once
https://github.com/FactoryBoy/factory_boy/pull/433 is merged and released, you could also use a `Trait` to enable
all post-generation hooks based on a flag:
class MyFactory:
class Params:
deep = factory.Trait(
x=factory.RelatedFactory(SomeOtherFactory, y=1),
)
--
Raphaël