Skip to content

Commit b68880f

Browse files
committed
Remove pytz from unit test
1 parent fcf9b3a commit b68880f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

main/authentication_test.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"""Tests for authentication"""
2-
2+
import zoneinfo
33
from datetime import datetime, timedelta
44

5-
import pytz
65
from django.conf import settings
76
from rest_framework_jwt.settings import api_settings
87

@@ -76,7 +75,7 @@ def test_ignore_expired_jwt_authentication_valid(rf, user):
7675
def test_ignore_expired_jwt_authentication_expired(rf, user):
7776
"""Tests that IgnoreExpiredJwtAuthentication returns None if token is expired"""
7877
payload = jwt_payload_handler(user)
79-
payload["exp"] = datetime.now(tz=pytz.timezone(settings.TIME_ZONE)) - timedelta(
78+
payload["exp"] = datetime.now(tz=zoneinfo.ZoneInfo(settings.TIME_ZONE)) - timedelta(
8079
seconds=100
8180
)
8281
token = jwt_encode_handler(payload)

0 commit comments

Comments
 (0)