-
Notifications
You must be signed in to change notification settings - Fork 25
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
loans: improve due date timezone consideration #684
Conversation
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.
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 job 👍
-
This test fails locally with this error:
pyt tests/api/test_loans_rest.py
# Compare year, month and date for Loan due date: should be the same!
fail_msg = "Check timezone for Loan and Library. It should be the same date, \
even if timezone changed."
assert loan_datetime.year == lib_datetime.year, fail_msg
assert loan_datetime.month == lib_datetime.month, fail_msg
> assert loan_datetime.day == lib_datetime.day, fail_msg
E AssertionError: Check timezone for Loan and Library. It should be the same date, even if timezone changed.
E assert 13 == 20
E -13
E +20
Any idea?
- This PR should now fix the two
TODO
s in the filetests/api/test_items_rest.py
:
line 632: # TODO: check why this test fails with this error @ travis
line 1248: # TODO: check whey this test fails with this error @travis
Could you please check this, thanks?
4495b4b
to
c04f993
Compare
c6bccf0
to
3d29507
Compare
* Closes rero#599 by using correct timezone for due date (it takes into account opening hours and exception dates correctly) * tests due date timezone * adds get_timezone() on Library that returns BABEL_DEFAULT_TIMEZONE as default * changes due date process to take into account Library timezone * adds library_pid property on Loan objects Co-Authored-by: Olivier DOSSMANN <[email protected]>
3d29507
to
c0d0088
Compare
Co-Authored-by: Olivier DOSSMANN [email protected]
Why are you opening this PR?
Cf. https://tree.taiga.io/project/rero21-reroils/task/1136 and #599
How to test?
It's explained in #599 . Pay attention to circulation policy and dates.
Code review check list