Allow check-in lists to include unpaid orders

This commit is contained in:
Raphael Michel
2018-02-21 16:08:53 +01:00
parent 36585395f1
commit 3fbccf3f64
15 changed files with 220 additions and 38 deletions

View File

@@ -172,6 +172,29 @@ def test_require_paid(client, env):
jdata = json.loads(resp.content.decode("utf-8"))
assert jdata['status'] == 'error'
assert jdata['reason'] == 'unpaid'
assert jdata['data']['checkin_allowed'] is False
@pytest.mark.django_db
def test_check_in_pending(client, env):
AppConfiguration.objects.create(event=env[0], key='abcdefg', list=env[5])
env[2].status = Order.STATUS_PENDING
env[2].save()
env[5].include_pending = True
env[5].save()
resp = client.post('/pretixdroid/api/%s/%s/redeem/?key=%s' % (env[0].organizer.slug, env[0].slug, 'abcdefg'),
data={'secret': '1234'})
jdata = json.loads(resp.content.decode("utf-8"))
assert jdata['status'] == 'error'
assert jdata['reason'] == 'unpaid'
assert jdata['data']['checkin_allowed'] is True
resp = client.post('/pretixdroid/api/%s/%s/redeem/?key=%s' % (env[0].organizer.slug, env[0].slug, 'abcdefg'),
data={'secret': '1234', 'ignore_unpaid': 'true'})
jdata = json.loads(resp.content.decode("utf-8"))
assert jdata['status'] == 'ok'
@pytest.mark.django_db