Skip to content

Add support to brazilian company IDs (CNPJ)#411

Merged
fcurella merged 3 commits intojoke2k:masterfrom
lamenezes:pt-br-company-id
Oct 28, 2016
Merged

Add support to brazilian company IDs (CNPJ)#411
fcurella merged 3 commits intojoke2k:masterfrom
lamenezes:pt-br-company-id

Conversation

@lamenezes
Copy link
Copy Markdown
Contributor

@ladylovelace
Copy link
Copy Markdown

This would be very helpful.
Good collaboration @lamenezes


@classmethod
def company_id(cls):
digits = random.sample(range(10), 8) + [0, 0, 0, 1]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of the global random module, you should use the provider's own random instance, so that it can be frozen. Simply call cls.random_sample, instead of random.sample. The API is the same

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@fcurella
Copy link
Copy Markdown
Collaborator

Thank you very much! Great work! ✨

@fcurella fcurella merged commit aa0b3a6 into joke2k:master Oct 28, 2016
@lamenezes lamenezes deleted the pt-br-company-id branch October 28, 2016 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants