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

Fix tests for UTC >=+ 4 timezones #2110

Merged
merged 1 commit into from
Feb 17, 2020
Merged

Conversation

felixonmars
Copy link
Contributor

Currently test_timestamp_field_from_ts assumes the timezone to be less than +4 so it remains the same day. This would fail when running with for example UTC+8:

======================================================================
FAIL: test_timestamp_field_parts (tests.fields.TestTimestampField)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-peewee/src/peewee-3.13.1/tests/fields.py", line 1066, in test_timestamp_field_parts
    self.assertEqual(d, 2)
AssertionError: 1 != 2

----------------------------------------------------------------------
Ran 859 tests in 3.450s

FAILED (failures=1, skipped=102)

Just comparing it with dt_utc.day fixes the failure.

Currently test_timestamp_field_from_ts assumes the timezone to be less than +4 so it remains the same day. This would fail when running with for example UTC+8:

```
======================================================================
FAIL: test_timestamp_field_parts (tests.fields.TestTimestampField)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python-peewee/src/peewee-3.13.1/tests/fields.py", line 1066, in test_timestamp_field_parts
    self.assertEqual(d, 2)
AssertionError: 1 != 2

----------------------------------------------------------------------
Ran 859 tests in 3.450s

FAILED (failures=1, skipped=102)
```

Just comparing it with dt_utc.day fixes the failure.
@coleifer coleifer merged commit b4189f6 into coleifer:master Feb 17, 2020
@coleifer
Copy link
Owner

Thanks!

@felixonmars felixonmars deleted the patch-1 branch February 17, 2020 01:24
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.

None yet

2 participants