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

@@ -33,7 +33,7 @@
# License for the specific language governing permissions and limitations under the License.
import copy
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
from decimal import Decimal
from unittest import mock
@@ -43,7 +43,6 @@ from django.core.files.base import ContentFile
from django.utils.timezone import now
from django_countries.fields import Country
from django_scopes import scopes_disabled
from pytz import UTC
from tests.const import SAMPLE_PNG
from pretix.base.models import (
@@ -63,15 +62,15 @@ def variations(item):
@pytest.fixture
def order(event, item, taxrule):
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
o = Order.objects.create(
code='FOO', event=event, email='dummy@dummy.test',
status=Order.STATUS_PENDING, secret="k24fiuwvu8kxz3y1",
datetime=datetime(2017, 12, 1, 10, 0, 0, tzinfo=UTC),
expires=datetime(2017, 12, 10, 10, 0, 0, tzinfo=UTC),
datetime=datetime(2017, 12, 1, 10, 0, 0, tzinfo=timezone.utc),
expires=datetime(2017, 12, 10, 10, 0, 0, tzinfo=timezone.utc),
total=23, locale='en'
)
o.fees.create(fee_type=OrderFee.FEE_TYPE_PAYMENT, value=Decimal('0.25'), tax_rate=Decimal('19.00'),