-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
locale pt-BR fixed official cellphone_formats and PhoneNumberProvider without DDD #1121
Conversation
… without DDD https://en.wikipedia.org/wiki/Telephone_numbers_in_Brazil All phone numbers must have the DDD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will also need to update the tests in tests.providers.test_phone_number.TestPtB
assert msisdn.isdigit() | ||
assert msisdn[0:4] in formats | ||
re.match(r"^[+]?([0-9]{2})?[ ]?[(]?[0]?\d{2}[)]?[ ]?[09]?[ ]?\d{4}[ -]?\d{4}$", msisdn) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per pep8, we only keep one line between methods. Could you remove this empty line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, didn't notice it.
It would be a good thing to set up pep8 verification on CI, with flake8 or some other lib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have it in Travis
Thank you! ✨ |
* Added company_vat faker * ISSUE-1123 handle leap day year shifts (#1124) When Faker attempts to generate a date_of_birth on 29th of February on the leap year it fails if it tries to return a year that is not also a leap year. This patch fixes the issue by extracting the year adjust to its own function that catches the ValueError and if the starting date is YYYY-02-29 it will adjust the date to YYYY-03-01. * Add generating random french licence plates (#1122) * Add initial failing test * Add french car licence plates * Fixed flake8 issue * Removed one source to pass flake8 tests Co-authored-by: Simon Persson <simon@akep.se> * Add HTTP methods random generator (#1119) * Add HTTP methods generator * Add tests for HTTP methods generator * Fix years in CHANGELOG.rst (#1127) * locale pt-BR fixed official cellphone_formats and PhoneNumberProvider without DDD (#1121) * 📝 Update CHANGELOG * Bump version: 4.0.1 → 4.0.2 * MSISDN is mobile number only (#1132) * Add dga by date (#1136) * Add Domain Generator Algorithm (DGA) by date * Add Domain Generator Algorithm (DGA) by date test * #1131 Fixes issue where pydict provider was not returing the correct number of elements. (#1137) * Adds support for Indian Aadhaar numbers (#1138) * Adds support for Indian Aadhaar numbers This change also introduces the en_IN locale. As we needed to use a Luhn check - moved an existing implementation to utils along with additional tests * Sort imports and changes for flake8 rules Co-authored-by: Dinu Nair <dinunair@gmail.com> Co-authored-by: Dinu Nair <dinu@esthenos.com> * Removing spaces * Added company_vat faker * Removing spaces * Use checkum calculator from commont utils * standardizing imports Co-authored-by: Marco <marco@esplores.com> Co-authored-by: Matt McMahon <matt.mcmahon@gmail.com> Co-authored-by: clarissedescamps <clarisse.descamps96@yahoo.fr> Co-authored-by: Simon Persson <simon@akep.se> Co-authored-by: Roman Pishchalnikov <roman.pishchalnikov@gmail.com> Co-authored-by: Laurent Bristiel <laurent@bristiel.com> Co-authored-by: Flavio Curella <89607+fcurella@users.noreply.github.com> Co-authored-by: fcurella <flavio.curella@gmail.com> Co-authored-by: Rodrigo Castro <rodrigondec@gmail.com> Co-authored-by: mstellon <39681459+mstellon@users.noreply.github.com> Co-authored-by: curiousElf <dinunair+github@gmail.com> Co-authored-by: Dinu Nair <dinunair@gmail.com> Co-authored-by: Dinu Nair <dinu@esthenos.com>
* Added company_vat faker * ISSUE-1123 handle leap day year shifts (joke2k#1124) When Faker attempts to generate a date_of_birth on 29th of February on the leap year it fails if it tries to return a year that is not also a leap year. This patch fixes the issue by extracting the year adjust to its own function that catches the ValueError and if the starting date is YYYY-02-29 it will adjust the date to YYYY-03-01. * Add generating random french licence plates (joke2k#1122) * Add initial failing test * Add french car licence plates * Fixed flake8 issue * Removed one source to pass flake8 tests Co-authored-by: Simon Persson <simon@akep.se> * Add HTTP methods random generator (joke2k#1119) * Add HTTP methods generator * Add tests for HTTP methods generator * Fix years in CHANGELOG.rst (joke2k#1127) * locale pt-BR fixed official cellphone_formats and PhoneNumberProvider without DDD (joke2k#1121) * 📝 Update CHANGELOG * Bump version: 4.0.1 → 4.0.2 * MSISDN is mobile number only (joke2k#1132) * Add dga by date (joke2k#1136) * Add Domain Generator Algorithm (DGA) by date * Add Domain Generator Algorithm (DGA) by date test * joke2k#1131 Fixes issue where pydict provider was not returing the correct number of elements. (joke2k#1137) * Adds support for Indian Aadhaar numbers (joke2k#1138) * Adds support for Indian Aadhaar numbers This change also introduces the en_IN locale. As we needed to use a Luhn check - moved an existing implementation to utils along with additional tests * Sort imports and changes for flake8 rules Co-authored-by: Dinu Nair <dinunair@gmail.com> Co-authored-by: Dinu Nair <dinu@esthenos.com> * Removing spaces * Added company_vat faker * Removing spaces * Use checkum calculator from commont utils * standardizing imports Co-authored-by: Marco <marco@esplores.com> Co-authored-by: Matt McMahon <matt.mcmahon@gmail.com> Co-authored-by: clarissedescamps <clarisse.descamps96@yahoo.fr> Co-authored-by: Simon Persson <simon@akep.se> Co-authored-by: Roman Pishchalnikov <roman.pishchalnikov@gmail.com> Co-authored-by: Laurent Bristiel <laurent@bristiel.com> Co-authored-by: Flavio Curella <89607+fcurella@users.noreply.github.com> Co-authored-by: fcurella <flavio.curella@gmail.com> Co-authored-by: Rodrigo Castro <rodrigondec@gmail.com> Co-authored-by: mstellon <39681459+mstellon@users.noreply.github.com> Co-authored-by: curiousElf <dinunair+github@gmail.com> Co-authored-by: Dinu Nair <dinunair@gmail.com> Co-authored-by: Dinu Nair <dinu@esthenos.com>
https://en.wikipedia.org/wiki/Telephone_numbers_in_Brazil
All phone numbers must have the DDD
What does this changes
The variation of phone_number generation on locale pt-BR
What was wrong
PhoneNumber formats
the format '####-####' is a bad practice (without DDD)
msisdn_formats
the format '55AA#########' is wrong because in the example '55AA412345678' the char at position 4 is only acceptable as a '9' digit else if must not exist this additional char.
it must be '55AA12345678' or '55AA912345678'
cellphone_formats
the format '+55 9#### ####' is wrong because is missing DDD, the correct would be '+55 ## 9#### ####'.
How this fixes it
It fixes these issues by correcting the formats for random_element generation