-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add Brazilian documents generation and documentation #1495
Conversation
Fix Faker::Internet.ip_v4_address to include all IP ranges (#1494)
Add alias for Brazilian ID number
I noticed the tests are a bit messy. Maybe it could have a test for the checksum methods so it validates the algorithm and another one for the generator, validating it generates a random value with the correct amount of digits + format |
Merge stympy/faker into lucasqueiroz/faker
I have refactored the tests so it doesn't require the checksum calculation inside the generator tests. |
Love this. Bumping to see if it can get merged - was going to make a similar change myself. |
69291b2
to
5cc660c
Compare
@lucasqueiroz could you fix the merge issues? I'd like to include this PR in version 2. Thanks 👍 |
Sure, will take a look at it asap! |
Merge stympy/faker into lucasqueiroz/faker
Hi @vbrazo, I have fixed the conflicts and added the RG generator to the ID documentation. Please let me know if there is any change required. Thanks! |
* Change default parameter format in brazilian_citizen_number * Add alias to brazilian_citizen_number * Add Brazilian ID generator * Change generator for Brazilian ID number Add alias for Brazilian ID number * Add docs for Brazilian Citizen Number (CPF) * Add docs for Brazilian ID (RG) * Add tests for brazilian id digit * Remove if statement from brazilian id digit method * Refactor brazilian_document_remainder and rename it to brazilian_document_digit * Add tests for brazilian_citizen_number_digit * Add tests for brazilian_document_digit * Add tests for brazilian_document_checksum * Add tests for brazilian_id_checksum_digit * Add tests for brazilian_citizen_number_checksum_digit * Simplify brazilian document tests * Add Brazilian ID (RG) to ID Number docs * Minor changes * Remove unused file * Minor fixes * Readd docs after deleting unreleased docs folder * docs
* Change default parameter format in brazilian_citizen_number * Add alias to brazilian_citizen_number * Add Brazilian ID generator * Change generator for Brazilian ID number Add alias for Brazilian ID number * Add docs for Brazilian Citizen Number (CPF) * Add docs for Brazilian ID (RG) * Add tests for brazilian id digit * Remove if statement from brazilian id digit method * Refactor brazilian_document_remainder and rename it to brazilian_document_digit * Add tests for brazilian_citizen_number_digit * Add tests for brazilian_document_digit * Add tests for brazilian_document_checksum * Add tests for brazilian_id_checksum_digit * Add tests for brazilian_citizen_number_checksum_digit * Simplify brazilian document tests * Add Brazilian ID (RG) to ID Number docs * Minor changes * Remove unused file * Minor fixes * Readd docs after deleting unreleased docs folder * docs
This Pull Request closes the issue #1208.
For this generation, I used the #1382 checksum generator (I separated it into two methods so it can be reused, added documentation and an alias).
It generates a valid Brazilian ID based on SSP rules.