First steps into pytz deprecation

This commit is contained in:
Raphael Michel
2023-02-01 13:12:24 +01:00
parent 1d46a96821
commit e4e7d50659
63 changed files with 341 additions and 362 deletions

View File

@@ -21,13 +21,12 @@
#
import copy
import json
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from unittest import mock
import pytest
from django.utils.timezone import now
from django_scopes import scopes_disabled
from pytz import UTC
from pretix.base.models import (
Event, Item, Order, OrderPosition, Organizer, Quota, Team, User,
@@ -89,7 +88,7 @@ RES_JOB = {
@pytest.mark.django_db
def test_api_list(env, client):
testtime = datetime(2017, 12, 1, 10, 0, 0, tzinfo=UTC)
testtime = datetime(2017, 12, 1, 10, 0, 0, tzinfo=timezone.utc)
with mock.patch('django.utils.timezone.now') as mock_now:
mock_now.return_value = testtime
@@ -109,7 +108,7 @@ def test_api_list(env, client):
@pytest.mark.django_db
def test_api_detail(env, client):
testtime = datetime(2017, 12, 1, 10, 0, 0, tzinfo=UTC)
testtime = datetime(2017, 12, 1, 10, 0, 0, tzinfo=timezone.UTC)
with mock.patch('django.utils.timezone.now') as mock_now:
mock_now.return_value = testtime