forked from CGM_Public/pretix_original
Remove deprecated auto_checkin_sales_channels (#4587)
* Remove deprecated auto_checkin_sales_channels * Fix Query count
This commit is contained in:
@@ -165,13 +165,6 @@ def order(event, item, taxrule, question):
|
||||
return o
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def clist_autocheckin(event):
|
||||
c = event.checkin_lists.create(name="Default", all_products=True)
|
||||
c.auto_checkin_sales_channels.add(event.organizer.sales_channels.get(identifier="web"))
|
||||
return c
|
||||
|
||||
|
||||
ORDER_CREATE_PAYLOAD = {
|
||||
"email": "dummy@dummy.test",
|
||||
"phone": "+49622112345",
|
||||
@@ -548,36 +541,6 @@ def test_order_create_positionids_addons_simulated(token_client, organizer, even
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_order_create_autocheckin(token_client, organizer, event, item, quota, question, clist_autocheckin):
|
||||
res = copy.deepcopy(ORDER_CREATE_PAYLOAD)
|
||||
res['positions'][0]['item'] = item.pk
|
||||
res['positions'][0]['answers'][0]['question'] = question.pk
|
||||
resp = token_client.post(
|
||||
'/api/v1/organizers/{}/events/{}/orders/'.format(
|
||||
organizer.slug, event.slug
|
||||
), format='json', data=res
|
||||
)
|
||||
assert resp.status_code == 201
|
||||
with scopes_disabled():
|
||||
o = Order.objects.get(code=resp.data['code'])
|
||||
assert clist_autocheckin.auto_checkin_sales_channels.contains(organizer.sales_channels.get(identifier="web"))
|
||||
assert o.positions.first().checkins.first().auto_checked_in
|
||||
|
||||
clist_autocheckin.auto_checkin_sales_channels.clear()
|
||||
|
||||
resp = token_client.post(
|
||||
'/api/v1/organizers/{}/events/{}/orders/'.format(
|
||||
organizer.slug, event.slug
|
||||
), format='json', data=res
|
||||
)
|
||||
assert resp.status_code == 201
|
||||
with scopes_disabled():
|
||||
o = Order.objects.get(code=resp.data['code'])
|
||||
assert clist_autocheckin.auto_checkin_sales_channels.count() == 0
|
||||
assert o.positions.first().checkins.count() == 0
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_order_create_require_approval_free(token_client, organizer, event, item, quota, question):
|
||||
res = copy.deepcopy(ORDER_CREATE_PAYLOAD)
|
||||
|
||||
Reference in New Issue
Block a user