forked from CGM_Public/pretix_original
Handle related fields in export_form_data (Z#23233538) (#6157)
This commit is contained in:
@@ -212,4 +212,17 @@ def membership_type(organizer):
|
||||
return organizer.membership_types.create(name='foo')
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def clist(event, item):
|
||||
c = event.checkin_lists.create(name="Default", all_products=False)
|
||||
c.limit_products.add(item)
|
||||
return c
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def clist_all(event, item):
|
||||
c = event.checkin_lists.create(name="Default", all_products=True)
|
||||
return c
|
||||
|
||||
|
||||
utils.setup_databases = scopes_disabled()(utils.setup_databases)
|
||||
|
||||
@@ -252,19 +252,6 @@ TEST_HISTORY_RES = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def clist(event, item):
|
||||
c = event.checkin_lists.create(name="Default", all_products=False)
|
||||
c.limit_products.add(item)
|
||||
return c
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def clist_all(event, item):
|
||||
c = event.checkin_lists.create(name="Default", all_products=True)
|
||||
return c
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_list_list(token_client, organizer, event, clist, item, subevent, django_assert_num_queries):
|
||||
res = dict(TEST_LIST_RES)
|
||||
|
||||
@@ -1079,3 +1079,18 @@ def test_event_edit_restrictions(client, event, organizer, user, team):
|
||||
assert _get_and_patch_event_export(user2_client, s2)
|
||||
assert _get_and_patch_event_export(team1_client, s2)
|
||||
assert _get_and_patch_event_export(user1_client, s2)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_event_checkinlist_patch(user_client, organizer, event, user, event_scheduled_export, clist):
|
||||
event_scheduled_export.export_identifier = "checkinlistpdf"
|
||||
event_scheduled_export.save()
|
||||
|
||||
resp = user_client.patch(
|
||||
'/api/v1/organizers/{}/events/{}/scheduled_exports/{}/'.format(organizer.slug, event.slug, event_scheduled_export.id),
|
||||
data={
|
||||
"export_form_data": {"list": clist.pk},
|
||||
},
|
||||
format='json',
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user