Please sign in to comment.
Fixing callables on model_mommy Recipe.
This commit addresses an issue with how callables were handled in model_mommy's Recipe class. Previously, callables were detected and resolved on the `_make` method of the Recipe class. This caused problems for things like the `_quantity` api, since subsequent calls to mommy.make would just return the same value that was first resolved in `_make`. If you tried to introduce randomness into your mommy generations, you'd find this to be impossible via Recipe and _quantity. We now pass callables straight through to `mommy.make`. There is new logic to detect a callable and guarantee that is called each time make is called. Additionally, a new test method has been introduced to ensure that the `_quantity` is handled correctly.
- Loading branch information...
Showing with 11 additions and 2 deletions.