mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Bump Django to 4.1.* (#2989)
This commit is contained in:
@@ -19,14 +19,13 @@
|
||||
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from decimal import Decimal
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
from django_countries.fields import Country
|
||||
from django_scopes import scopes_disabled
|
||||
from pytz import UTC
|
||||
|
||||
from pretix.base.models import (
|
||||
InvoiceAddress, Order, OrderPosition, SeatingPlan, SubEvent,
|
||||
@@ -52,15 +51,15 @@ def variations2(item2):
|
||||
|
||||
@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'),
|
||||
@@ -344,8 +343,8 @@ def test_subevent_update(token_client, organizer, event, subevent, item, item2,
|
||||
assert resp.status_code == 200
|
||||
with scopes_disabled():
|
||||
subevent = event.subevents.get(id=subevent.id)
|
||||
assert subevent.date_from == datetime(2018, 12, 27, 10, 0, tzinfo=UTC)
|
||||
assert subevent.date_to == datetime(2018, 12, 28, 10, 0, tzinfo=UTC)
|
||||
assert subevent.date_from == datetime(2018, 12, 27, 10, 0, tzinfo=timezone.utc)
|
||||
assert subevent.date_to == datetime(2018, 12, 28, 10, 0, tzinfo=timezone.utc)
|
||||
|
||||
resp = token_client.patch(
|
||||
'/api/v1/organizers/{}/events/{}/subevents/{}/'.format(organizer.slug, event.slug, subevent.pk),
|
||||
|
||||
Reference in New Issue
Block a user