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

Pytest Timezone Warning Fixed #5739

Merged
merged 1 commit into from Jun 5, 2019
Merged

Conversation

@saadmk11
Copy link
Member

@saadmk11 saadmk11 commented May 30, 2019

While running tox -e py36 was getting fludded with pytest warnings like this:

readthedocs/api/v3/tests/test_projects.py::APIEndpointTests::test_unauthed_others_projects_detail
  /home/saad/dev/readthedocs.org/.tox/py36/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1451: RuntimeWarning: DateTimeField User.date_joined received a naive datetime (2019-04-29 10:00:00) while time zone support is active.
    RuntimeWarning)
  /home/saad/dev/readthedocs.org/.tox/py36/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1451: RuntimeWarning: DateTimeField Project.pub_date received a naive datetime (2019-04-29 10:00:00) while time zone support is active.
    RuntimeWarning)
  /home/saad/dev/readthedocs.org/.tox/py36/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1451: RuntimeWarning: DateTimeField Project.modified_date received a naive datetime (2019-04-29 12:00:00) while time zone support is active.
    RuntimeWarning)
  /home/saad/dev/readthedocs.org/.tox/py36/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1451: RuntimeWarning: DateTimeField Project.pub_date received a naive datetime (2019-04-29 10:00:00) while time zone support is active.
    RuntimeWarning)
  /home/saad/dev/readthedocs.org/.tox/py36/lib/python3.6/site-packages/django/db/models/fields/__init__.py:1451: RuntimeWarning: DateTimeField Project.modified_date received a naive datetime (2019-04-29 12:00:00) while time zone support is active.

made the datetime objects timezone aware to avoid getting these warnings.

@saadmk11 saadmk11 requested a review from May 30, 2019
stsewd
stsewd approved these changes May 30, 2019
@stsewd stsewd requested a review from May 30, 2019
@ericholscher
Copy link
Member

@ericholscher ericholscher commented Jun 5, 2019

Simple enough 👍

Loading

@ericholscher ericholscher merged commit c64af2d into readthedocs:master Jun 5, 2019
1 check passed
Loading
@saadmk11 saadmk11 deleted the pytest-warning branch Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants