-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faker class generate method with default locale #790
Comments
Hi! Thanks for the report. There is indeed something wrong with the latest release, but I haven't found the time to look into it — see #788 #787 #786 #785… However, please note that the As described here, the |
Any update here? when do you plan to move this to pypi package? (kwargs.pop('locale') keyerror) |
Unrolling the extra context for a declaration might depend on the declaration's internals; that's typically the case with factory.Maybe: the inner declarations might depend on the actual declaration used. This adds `evaluate_pre` and a `evaluate_post` entrypoints to declarations, more readable with regard to which build phase they are used in. Each of those will perform unrolling before calling the semi-public actual function entrypoint (self.evaluate() for evaluate_pre, self.call() for evaluate_post). As a side effect, this fixes the issues with factory.Faker() when called inside a factory.Maybe(). Closes #785 #786 #787 #788 #790 #796.
Unrolling the extra context for a declaration might depend on the declaration's internals; that's typically the case with factory.Maybe: the inner declarations might depend on the actual declaration used. This adds `evaluate_pre` and a `evaluate_post` entrypoints to declarations, more readable with regard to which build phase they are used in. Each of those will perform unrolling before calling the semi-public actual function entrypoint (self.evaluate() for evaluate_pre, self.call() for evaluate_post). As a side effect, this fixes the issues with factory.Faker() when called inside a factory.Maybe(). Closes #785 #786 #787 #788 #790 #796.
This has been fixed in #828; a new release should be made in the next couple of days :) |
The problem
I have a old version in my project, then using Faker class, i generate faker name with Faker("name") but in newer versions i have using Faker("name").generate(), thats problem is, when i using the generate method without params, the 'locale' key error is getted
Proposed solution
If the developer does not provide a dictionary with a locale, a default locale is provided.
Extra notes
factory_boy version 3.1.0
The text was updated successfully, but these errors were encountered: