forked from CGM_Public/pretix_original
Add API endpoint /seats to event (Z#23159536) (#4321)
* add API endpoint /seats to event * fix logging * add Seat annotations * add seats endpoint for subevents * return ids of occupying objects instead of boolean flags * wip * include orderposition instead of order in seat info * add API documentation * Apply suggestions from code review Co-authored-by: Raphael Michel <michel@rami.io> * Apply suggestions from code review * Clarify API docs * add api examples * add test cases * require can_view_orders permission for retrieving seats * improve permission handling * Revert "improve permission handling" This reverts commit f32b532cc68760a8a4af03208bd17e75e8c5723d. * improve permission handling (minimal version) * formatting * add permission tests * fix bug * update permission checks * Apply suggestions from code review Co-authored-by: Raphael Michel <michel@rami.io> * add tests for permission checks * add tests for expand=voucher and expand=cartposition * remove unused parameter * test query count * codestyle --------- Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
@@ -2010,6 +2010,14 @@ def test_order_create_with_seat(token_client, organizer, event, item, quota, sea
|
||||
p = o.positions.first()
|
||||
assert p.seat == seat
|
||||
|
||||
resp = token_client.get('/api/v1/organizers/{}/events/{}/seats/{}/'.format(organizer.slug, event.slug, seat.pk))
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['orderposition'] == p.pk
|
||||
|
||||
resp = token_client.get('/api/v1/organizers/{}/events/{}/seats/{}/?expand=orderposition'.format(organizer.slug, event.slug, seat.pk))
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['orderposition']['id'] == p.pk
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_order_create_with_blocked_seat_allowed(token_client, organizer, event, item, quota, seat, question):
|
||||
|
||||
Reference in New Issue
Block a user