Skip to content

Commit

Permalink
django.utils.timezone.utc was remove in Django 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Jan 22, 2024
1 parent 642f321 commit db1d549
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/functional/dashboard/test_review.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from datetime import timedelta
from datetime.timezone import utc
from datetime import timedelta, timezone as datetime_timezone

from django.urls import reverse
from django.utils import timezone
Expand Down Expand Up @@ -84,7 +83,9 @@ def n_days_ago(days):
The tests below pass timestamps as GET parameters, but the
ProductReviewSearchForm doesn't recognize the timezone notation.
"""
return timezone.make_naive(now - timedelta(days=days), timezone=utc)
return timezone.make_naive(
now - timedelta(days=days), timezone=datetime_timezone.utc
)

now = timezone.now()
review1 = ProductReviewFactory()
Expand Down

0 comments on commit db1d549

Please sign in to comment.