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

tests: fix problems with daylight saving time #836

Merged
merged 1 commit into from
Mar 5, 2020

Conversation

blankoworld
Copy link
Contributor

  • Fixes test that have problem twice a year with daylight saving time
    timezone

Co-Authored-by: Olivier DOSSMANN [email protected]

Why are you opening this PR?

To fix problems about timezones in tests.

How to test?

pipenv run pytest -vvs --no-cov --disable-warnings tests/api/test_loans_rest.py::test_due_soon_loans

Code review check list

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

@blankoworld blankoworld requested review from BadrAly, zannkukai and jma March 4, 2020 21:37
Copy link
Contributor

@jma jma left a comment

Choose a reason for hiding this comment

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

Please fix the travis tests for this PR.


# should be 14:59/15:59 in US/Pacific (because of daylight saving time)
check_timezone_date(pytz.timezone('US/Pacific'), loan_date, [14, 15])
check_timezone_date(pytz.timezone('Europe/Amsterdam'), loan_date)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why here the expected parameter is not defined as this timezone have also a winter and summer time GMT+1 and GMT+2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I consider that Europe/Zurich was so close to Europe/Amsterdam that we can be confident about the result: it would be 1 or 2 hours of difference.
Do you prefer I add them too?

@blankoworld blankoworld force-pushed the doo-fix-tz-daylight-test branch from ea315fc to cce783e Compare March 5, 2020 07:30
@blankoworld blankoworld force-pushed the doo-fix-tz-daylight-test branch from cce783e to a5f1355 Compare March 5, 2020 08:04
* Fixes test that have problem twice a year with daylight saving time
  timezone

Co-Authored-by: Olivier DOSSMANN <[email protected]>
@blankoworld blankoworld force-pushed the doo-fix-tz-daylight-test branch from a5f1355 to 65eb6a1 Compare March 5, 2020 08:58
@blankoworld blankoworld merged commit 88e4db9 into rero:dev Mar 5, 2020
@blankoworld blankoworld deleted the doo-fix-tz-daylight-test branch March 30, 2020 15:11
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.

3 participants