Skip to content
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

Passport Provider and EN_US Implementation #1860

Merged
merged 5 commits into from
Jun 1, 2023

Conversation

llw2128
Copy link
Contributor

@llw2128 llw2128 commented May 3, 2023

What does this change

Added a passport faking functionality

What was wrong

#1853
Addressed one of the desired functionalities

How this fixes it

This adds a new provider that fakes passport data, specifically numbers, issue and expiry dates, and birthdays

linting

fixed testing issues caused by string formatting

fixed line length linting issues, and import *

fixed import* in tests, removed unused variable
faker/providers/passport/en_US/__init__.py Outdated Show resolved Hide resolved
faker/providers/passport/en_US/__init__.py Outdated Show resolved Hide resolved
faker/providers/passport/__init__.py Outdated Show resolved Hide resolved
faker/providers/passport/en_US/__init__.py Outdated Show resolved Hide resolved
issue_date = self.generator.date_time_between(today - timedelta(days=EXPIRY_YEARS * 365 - 1), today)
age_issue = (issue_date.date() - birthday).days // 365

if age_issue < 16:
Copy link
Collaborator

Choose a reason for hiding this comment

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

You're already catching age < 16 in the first case of thisif. I'm not sure how we would end up in this branch here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworked logic on this, updated to remove unnecessary conditions

faker/providers/passport/en_US/__init__.py Show resolved Hide resolved
Copy link
Collaborator

@fcurella fcurella left a comment

Choose a reason for hiding this comment

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

just some minor fixes on terminology :)

faker/providers/passport/en_US/__init__.py Outdated Show resolved Hide resolved
faker/providers/passport/en_US/__init__.py Outdated Show resolved Hide resolved
faker/providers/passport/__init__.py Outdated Show resolved Hide resolved
fixed grammar mistake
Copy link
Collaborator

@fcurella fcurella left a comment

Choose a reason for hiding this comment

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

Thank you! 🏳️‍🌈

@fcurella fcurella merged commit 0e5f1c4 into joke2k:master Jun 1, 2023
29 checks passed
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.

None yet

2 participants