-
Notifications
You must be signed in to change notification settings - Fork 3
autogenerated date for test #845
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
Conversation
|
This branch is working on a ticket in the NHS England VED JIRA Project. Here's a handy link to the ticket: VED-307 |
| "2100-01-01", # Year in future | ||
| "2050-12-31", # Year in future | ||
| "2029-06-15", # Year in future | ||
| (datetime.now() + timedelta(days=random.randint(1, 30))).strftime("%Y-%m-%d") |
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.
Thanks for doing this. I would question whether we need to do random and 3 different points.
Maybe just some boundary tests e.g. 1 day ahead and 1 or 2 years ahead would be sufficient.
Optional - or maybe you already did it, but could be nice to test that the same day is successful i.e. it is not flagged as a future date. maybe that test was implemented somewhere else though. And happy for it to be left out too.
| now = datetime.now() | ||
| sample_inputs = [ | ||
| now + timedelta(days=1), | ||
| now + timedelta(days=365), |
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.
Good set of test cases. Always preferred to mock datetime/now but in place of this, the approach used is fine.
backend/tests/utils/generic_utils.py
Outdated
| ) | ||
| return json_data | ||
|
|
||
| def format_future_dates(dates: List[Union[date, datetime]], mode: str = "auto") -> List[str]: |
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.
Don't think this helper function has anything to do with the future. Is just a helped to format a some datetime or date strings.
|
* autogenerated date for test and remove PII logs



Summary
Add any other relevant notes or explanations here. Remove this line if you have nothing to add.
Reviews Required
Review Checklist
ℹ️ This section is to be filled in by the reviewer.