Skip to content

Conversation

@MorganaSilva
Copy link

Details

  • Faker version: master
  • OS: Any

Reason

The current pt_BR (Portuguese - Brazil) internet provider data is outdated. It lacks common modern email providers, has some inconsistencies in TLD formatting, and the username generation logic could better handle specific Portuguese accented characters for more realistic slugs.

Changes

  • Provider Implementation (faker/providers/internet/pt_BR/__init__.py):

    • Updated email domains: Added popular domains like outlook.com.br, outlook.com, icloud.com, and yahoo.com.br to reflect current usage in Brazil.
    • Fixed TLDs: Ensured TLDs like com.br do not have leading dots to avoid double-dot issues in generated URLs.
    • Improved transliteration: Enhanced the logic to correctly convert Portuguese accented characters (e.g., ã, õ, ç, á) into ASCII for usernames and slugs (e.g., João -> joao).
  • Testing (tests/providers/test_internet.py):

    • Updated TestPtBr: Replaced the basic test class with a comprehensive one.
    • New assertions: Added tests to verify the presence of new domains, correct TLD formatting, and proper character replacement in generated emails.

- Add modern free email domains (outlook, icloud, etc)
- Fix TLD formats (remove leading dots)
- Improve username generation handling accented characters (ã, õ, á, etc)
- Update and expand tests for pt_BR internet provider
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.

1 participant