mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Check-in: Fix crash on medium scan that is mapped to wrong event (PRETIXEU-9P0)
This commit is contained in:
@@ -308,6 +308,25 @@ def test_by_medium_not_connected(token_client, organizer, clist, event, order):
|
||||
assert resp.data['reason'] == 'invalid'
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_by_medium_wrong_event(token_client, organizer, clist, event, order2):
|
||||
with scopes_disabled():
|
||||
ReusableMedium.objects.create(
|
||||
type="barcode",
|
||||
identifier="abcdef",
|
||||
organizer=organizer,
|
||||
linked_orderposition=order2.positions.first(),
|
||||
)
|
||||
resp = _redeem(token_client, organizer, clist, "abcdef", {"source_type": "barcode"})
|
||||
assert resp.status_code == 404
|
||||
assert resp.data['status'] == 'error'
|
||||
assert resp.data['reason'] == 'invalid'
|
||||
with scopes_disabled():
|
||||
ci = clist.checkins.get()
|
||||
assert ci.raw_barcode == "abcdef"
|
||||
assert ci.raw_source_type == "barcode"
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_by_medium_wrong_type(token_client, organizer, clist, event, order):
|
||||
with scopes_disabled():
|
||||
|
||||
Reference in New Issue
Block a user