factory_boy
factory_boy copied to clipboard
Ability to reset all iterators on a factory
The problem
Please describe the problem you're encountering (e.g "It's very complex to do [...]")
Factory.reset_sequence()
allows for the reset of all sequences on a factory but there is no equivalent for Iterators. This makes it difficult to fully reset a factory without avoiding Iterator or calling Iterator.reset()
on every Iterator attached to the factory.
Proposed solution
Please provide some wild idea you think could solve this issue. It's much easier to work from an existing suggestion :)
- Add a
reset_iterator()
function to factories that will reset all iterators. - Add a
reset_all()
/reset()
function to factories that will fully reset all of their state - Have
reset_sequence()
reset Iterators as well.
Extra notes
Any notes you feel interesting to include: alternatives you've considered, reasons to include the change, anything!