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

loans: improve due date timezone consideration #684

Merged
merged 1 commit into from
Jan 14, 2020

Conversation

blankoworld
Copy link
Contributor

  • 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]

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

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?

Copy link

@iGormilhit iGormilhit left a comment

Choose a reason for hiding this comment

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

Does this commit closes #599? If so, add ´Closes #599´ and a line that explain that opening hours and exceptions are correctly taken into account, now. Thanks.

I've tested it on localhost, and your commit does address #599 issue.

Copy link

@BadrAly BadrAly left a comment

Choose a reason for hiding this comment

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

  1. good job 👍

  2. 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?

  1. This PR should now fix the two TODOs in the file tests/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?

@blankoworld blankoworld added the WIP label Jan 9, 2020
@blankoworld blankoworld force-pushed the doo-#1136-due-date branch 2 times, most recently from 4495b4b to c04f993 Compare January 10, 2020 09:51
@blankoworld blankoworld removed the WIP label Jan 10, 2020
@blankoworld blankoworld force-pushed the doo-#1136-due-date branch 2 times, most recently from c6bccf0 to 3d29507 Compare January 10, 2020 10:56
* 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]>
@blankoworld blankoworld merged commit 01595a3 into rero:dev Jan 14, 2020
@blankoworld blankoworld deleted the doo-#1136-due-date branch March 30, 2020 15:06
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.

4 participants