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

Remove pytz from unit test #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions main/authentication_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""Tests for authentication"""

import zoneinfo
from datetime import datetime, timedelta

import pytz
from django.conf import settings
from rest_framework_jwt.settings import api_settings

Expand Down Expand Up @@ -76,7 +75,7 @@ def test_ignore_expired_jwt_authentication_valid(rf, user):
def test_ignore_expired_jwt_authentication_expired(rf, user):
"""Tests that IgnoreExpiredJwtAuthentication returns None if token is expired"""
payload = jwt_payload_handler(user)
payload["exp"] = datetime.now(tz=pytz.timezone(settings.TIME_ZONE)) - timedelta(
payload["exp"] = datetime.now(tz=zoneinfo.ZoneInfo(settings.TIME_ZONE)) - timedelta(
seconds=100
)
token = jwt_encode_handler(payload)
Expand Down
Loading