mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Bump versions of pycodestyle and pep8-naming
This commit is contained in:
@@ -31,7 +31,7 @@ tz = pytz.timezone("Asia/Tokyo")
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_no_events(device_client, device):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection?current_event=e1')
|
||||
resp = device_client.get('/api/v1/device/eventselection?current_event=e1')
|
||||
assert resp.status_code == 404
|
||||
|
||||
|
||||
@@ -66,26 +66,26 @@ def test_choose_between_events(device_client, device):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection?current_event=e1¤t_checkinlist={cl1.pk}')
|
||||
assert resp.status_code == 304
|
||||
with freeze_time("2020-01-10T16:30:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection?current_event=e1')
|
||||
resp = device_client.get('/api/v1/device/eventselection?current_event=e1')
|
||||
assert resp.status_code == 200
|
||||
resp = device_client.get(f'/api/v1/device/eventselection?current_event=e2')
|
||||
resp = device_client.get('/api/v1/device/eventselection?current_event=e2')
|
||||
assert resp.status_code == 304
|
||||
|
||||
# Next one only
|
||||
with freeze_time("2020-01-10T12:30:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['event']['slug'] == 'e1'
|
||||
|
||||
# Last one only
|
||||
with freeze_time("2020-01-10T17:30:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['event']['slug'] == 'e2'
|
||||
|
||||
# Running one
|
||||
with freeze_time("2020-01-10T14:30:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['event']['slug'] == 'e1'
|
||||
with freeze_time("2020-01-10T16:01:00+09:00"):
|
||||
@@ -108,11 +108,11 @@ def test_choose_between_events(device_client, device):
|
||||
|
||||
# Switch at half-time
|
||||
with freeze_time("2020-01-10T15:29:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['event']['slug'] == 'e1'
|
||||
with freeze_time("2020-01-10T15:31:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['event']['slug'] == 'e2'
|
||||
|
||||
@@ -120,9 +120,9 @@ def test_choose_between_events(device_client, device):
|
||||
e2.date_admission = tz.localize(datetime(2020, 1, 10, 14, 45))
|
||||
e2.save()
|
||||
with freeze_time("2020-01-10T14:45:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection?current_event=e1')
|
||||
resp = device_client.get('/api/v1/device/eventselection?current_event=e1')
|
||||
assert resp.status_code == 200
|
||||
resp = device_client.get(f'/api/v1/device/eventselection?current_event=e2')
|
||||
resp = device_client.get('/api/v1/device/eventselection?current_event=e2')
|
||||
assert resp.status_code == 304
|
||||
|
||||
|
||||
@@ -165,21 +165,21 @@ def test_choose_between_subevents(device_client, device):
|
||||
|
||||
# Next one only
|
||||
with freeze_time("2020-01-10T12:30:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['event']['slug'] == 'e1'
|
||||
assert resp.data['subevent'] == se1.pk
|
||||
|
||||
# Last one only
|
||||
with freeze_time("2020-01-10T17:30:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['event']['slug'] == 'e1'
|
||||
assert resp.data['subevent'] == se2.pk
|
||||
|
||||
# Running one
|
||||
with freeze_time("2020-01-10T14:30:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['event']['slug'] == 'e1'
|
||||
assert resp.data['subevent'] == se1.pk
|
||||
@@ -193,7 +193,7 @@ def test_choose_between_subevents(device_client, device):
|
||||
|
||||
# Prefer the one on the same day
|
||||
with freeze_time("2020-01-10T23:59:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['event']['slug'] == 'e1'
|
||||
assert resp.data['subevent'] == se2.pk
|
||||
@@ -207,12 +207,12 @@ def test_choose_between_subevents(device_client, device):
|
||||
|
||||
# Switch at half-time
|
||||
with freeze_time("2020-01-10T15:29:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.status_code == 200
|
||||
assert resp.data['event']['slug'] == 'e1'
|
||||
assert resp.data['subevent'] == se1.pk
|
||||
with freeze_time("2020-01-10T15:31:00+09:00"):
|
||||
resp = device_client.get(f'/api/v1/device/eventselection')
|
||||
resp = device_client.get('/api/v1/device/eventselection')
|
||||
assert resp.data['event']['slug'] == 'e1'
|
||||
assert resp.data['subevent'] == se2.pk
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ def test_org_list(token_client, organizer, event):
|
||||
resp = token_client.get('/api/v1/organizers/{}/exporters/'.format(organizer.slug))
|
||||
assert resp.status_code == 200
|
||||
assert c in resp.data['results']
|
||||
resp = token_client.get('/api/v1/organizers/{}/exporters/orderlist/'.format(organizer.slug, event.slug))
|
||||
resp = token_client.get('/api/v1/organizers/{}/exporters/orderlist/'.format(organizer.slug))
|
||||
assert resp.status_code == 200
|
||||
assert c == resp.data
|
||||
|
||||
|
||||
@@ -133,10 +133,10 @@ def test_ignore_get(token_client, organizer, event):
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_ignore_outside_api(token_client, organizer):
|
||||
resp = token_client.post('/control/login'.format(organizer.slug),
|
||||
resp = token_client.post('/control/login',
|
||||
PAYLOAD, format='json', HTTP_X_IDEMPOTENCY_KEY='foo')
|
||||
assert resp.status_code == 200
|
||||
resp = token_client.post('/control/invalid/'.format(organizer.slug),
|
||||
resp = token_client.post('/control/invalid/',
|
||||
PAYLOAD, format='json', HTTP_X_IDEMPOTENCY_KEY='foo')
|
||||
assert resp.status_code == 302
|
||||
|
||||
|
||||
Reference in New Issue
Block a user