mirror of
https://github.com/pretix/pretix.git
synced 2026-08-09 10:37:50 +00:00
adjust more tests
This commit is contained in:
@@ -437,7 +437,7 @@ def test_list_all_items_positions(token_client, organizer, event, clist, clist_a
|
||||
p3["addon_to"] = p1["id"]
|
||||
|
||||
# All items
|
||||
with django_assert_num_queries(24):
|
||||
with django_assert_num_queries(22):
|
||||
resp = token_client.get('/api/v1/organizers/{}/events/{}/checkinlists/{}/positions/?ordering=positionid'.format(
|
||||
organizer.slug, event.slug, clist_all.pk
|
||||
))
|
||||
|
||||
@@ -1865,7 +1865,7 @@ def test_event_expand_seat_filter_and_querycount(token_client, organizer, event,
|
||||
assert resp.status_code == 200
|
||||
event.refresh_from_db()
|
||||
|
||||
with assert_num_queries(12):
|
||||
with assert_num_queries(10):
|
||||
resp = token_client.get('/api/v1/organizers/{}/events/{}/seats/'
|
||||
'?expand=orderposition&expand=cartposition&expand=voucher&is_available=true'
|
||||
.format(organizer.slug, event.slug))
|
||||
@@ -1875,7 +1875,7 @@ def test_event_expand_seat_filter_and_querycount(token_client, organizer, event,
|
||||
with scope(organizer=organizer):
|
||||
v0 = event.vouchers.create(item=item, seat=event.seats.get(seat_guid='0-0'))
|
||||
|
||||
with assert_num_queries(14):
|
||||
with assert_num_queries(12):
|
||||
resp = token_client.get('/api/v1/organizers/{}/events/{}/seats/'
|
||||
'?expand=orderposition&expand=cartposition&expand=voucher&is_available=false'
|
||||
.format(organizer.slug, event.slug))
|
||||
@@ -1883,7 +1883,7 @@ def test_event_expand_seat_filter_and_querycount(token_client, organizer, event,
|
||||
assert len(resp.data['results']) == 1
|
||||
assert resp.data['results'][0]['voucher']['id'] == v0.pk
|
||||
|
||||
with assert_num_queries(12):
|
||||
with assert_num_queries(10):
|
||||
resp = token_client.get('/api/v1/organizers/{}/events/{}/seats/'
|
||||
'?expand=orderposition&expand=cartposition&expand=voucher&is_available=true'
|
||||
.format(organizer.slug, event.slug))
|
||||
@@ -1894,7 +1894,7 @@ def test_event_expand_seat_filter_and_querycount(token_client, organizer, event,
|
||||
v1 = event.vouchers.create(item=item, seat=event.seats.get(seat_guid='0-1'))
|
||||
v2 = event.vouchers.create(item=item, seat=event.seats.get(seat_guid='0-2'))
|
||||
|
||||
with assert_num_queries(16):
|
||||
with assert_num_queries(14):
|
||||
resp = token_client.get('/api/v1/organizers/{}/events/{}/seats/'
|
||||
'?expand=orderposition&expand=cartposition&expand=voucher&is_available=false'
|
||||
.format(organizer.slug, event.slug))
|
||||
|
||||
@@ -425,7 +425,7 @@ def test_item_list(token_client, organizer, event, team, item):
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_item_list_queries(token_client, organizer, event, team, item, item3):
|
||||
with assert_num_queries(18):
|
||||
with assert_num_queries(16):
|
||||
resp = token_client.get('/api/v1/organizers/{}/events/{}/items/'.format(organizer.slug, event.slug))
|
||||
assert resp.status_code == 200
|
||||
|
||||
|
||||
@@ -1166,10 +1166,10 @@ def test_orderposition_list(
|
||||
'type': 'entry'
|
||||
}]
|
||||
if '/events/' in endpoint:
|
||||
with django_assert_num_queries(18):
|
||||
with django_assert_num_queries(16):
|
||||
resp = token_client.get(endpoint + '?has_checkin=true')
|
||||
else:
|
||||
with django_assert_num_queries(17):
|
||||
with django_assert_num_queries(15):
|
||||
resp = token_client.get(endpoint + '?has_checkin=true')
|
||||
assert [res] == resp.data['results']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user