Open Volneirj opened 3 months ago
How the error has been handled:
Model Change Replaced the due_date for a datetime.now for timezone.now.
Test Changes Remove the need to sanitize the expected due_date during the test.
Output after changes The dates now have the same format and are not giving error when subtract the timedelta.
As a developer, I want to ensure that all time-related operations in the book issuance feature handle timezone differences accurately, so that users do not encounter errors due to time discrepancies when issuing or returning books.
Acceptance Criteria
AC 1 Ensure that all time-related operations (e.g., issue_date, due_date, and return_date) use timezone-aware methods (e.g., timezone.now() instead of datetime.now()) to avoid any discrepancies due to timezone differences.
AC 2 Validate that the book issuance and return processes function correctly across different timezones without causing time gaps or errors, such as those due to daylight saving time changes
AC 3 Implement and test that time calculations (e.g., setting due_date to 14 days from issuance) consistently reflect the correct date and time, regardless of the user's or server's timezone settings.
Failing test: Output from test: Test Model