Closed willsthompson closed 2 years ago
The API documentation for Address.country() indicates that it will "Get the country of the current locale", but the current local is not applied, and it instead always returns a random country:
Address.country()
>>> en = mimesis.Address(locale=Locale.EN) >>> en.country() 'Nicaragua' >>> en.country() 'Venezuela' >>> en.country() 'Fiji'
Additionally, the function docs include the parameter allow_random. However, this has not been implemented:
allow_random
>>> en.country(allow_random=False) Traceback (most recent call last): File "/Users/willthompson/.pyenv/versions/3.9.11/lib/python3.9/code.py", line 90, in runcode exec(code, self.locals) File "<input>", line 1, in <module> TypeError: country() got an unexpected keyword argument 'allow_random'
Behavior should align with the documentation:
False
It looks like this was already implemented in #1114, but closed before merging. Could that be reopened and fixed up?
Absolutely. Can you, please, create a PR?
@lk-geimfari Sure, I'm happy to do it, but it would essentially be duplicating #1114. Would you rather reopen that one?
Bug report
What's wrong
The API documentation for
Address.country()
indicates that it will "Get the country of the current locale", but the current local is not applied, and it instead always returns a random country:Additionally, the function docs include the parameter
allow_random
. However, this has not been implemented:How is that should be
Behavior should align with the documentation:
allow_random
parameter that ignores the locale when set toFalse
It looks like this was already implemented in #1114, but closed before merging. Could that be reopened and fixed up?