1
0
Fork 0

django.utils.timezone.utc alias is deprecated

This commit is contained in:
Bart Schuurmans 2024-03-29 21:38:48 +01:00
parent 0d621b68e0
commit 92a94d2fdc
9 changed files with 23 additions and 20 deletions

View file

@ -123,8 +123,8 @@ class ImportViews(TestCase):
"""Give people a sense of the timing"""
models.ImportJob.objects.create(
user=self.local_user,
created_date=datetime.datetime(2000, 1, 1),
updated_date=datetime.datetime(2001, 1, 1),
created_date=datetime.datetime(2000, 1, 1, tzinfo=datetime.timezone.utc),
updated_date=datetime.datetime(2001, 1, 1, tzinfo=datetime.timezone.utc),
status="complete",
complete=True,
mappings={},

View file

@ -1,5 +1,5 @@
"""testing the annual summary page"""
from datetime import datetime
import datetime
from unittest.mock import patch
import pytz
@ -15,7 +15,7 @@ from bookwyrm.tests.validate_html import validate_html
def make_date(*args):
"""helper function to easily generate a date obj"""
return datetime(*args, tzinfo=pytz.UTC)
return datetime.datetime(*args, tzinfo=pytz.UTC)
class AnnualSummary(TestCase):

View file

@ -1,8 +1,7 @@
""" tests updating reading progress """
from datetime import datetime
from datetime import datetime, timezone
from unittest.mock import patch
from django.test import TestCase, Client
from django.utils import timezone
from bookwyrm import models