API: add api_meta to order

This commit is contained in:
Richard Schreiber
2024-07-18 10:01:03 +02:00
committed by GitHub
parent 9e61f7f978
commit 22e2143623
11 changed files with 70 additions and 10 deletions

View File

@@ -255,6 +255,9 @@ def test_order_update_allowed_fields(token_client, organizer, event, order):
organizer.slug, event.slug, order.code
), format='json', data={
'comment': 'Here is a comment',
'api_meta': {
'test': 1
},
'valid_if_pending': True,
'custom_followup_at': '2021-06-12',
'checkin_attention': True,
@@ -280,6 +283,9 @@ def test_order_update_allowed_fields(token_client, organizer, event, order):
assert resp.status_code == 200
order.refresh_from_db()
assert order.comment == 'Here is a comment'
assert order.api_meta == {
'test': 1
}
assert order.custom_followup_at.isoformat() == '2021-06-12'
assert order.checkin_attention
assert order.checkin_text == 'foobar'

View File

@@ -232,6 +232,9 @@ def test_order_create(token_client, organizer, event, item, quota, question):
with scopes_disabled():
customer = organizer.customers.create()
res['customer'] = customer.identifier
res['api_meta'] = {
'test': 1
}
resp = token_client.post(
'/api/v1/organizers/{}/events/{}/orders/'.format(
organizer.slug, event.slug
@@ -251,6 +254,9 @@ def test_order_create(token_client, organizer, event, item, quota, question):
assert o.valid_if_pending
assert o.expires > now()
assert not o.testmode
assert o.api_meta == {
'test': 1
}
with scopes_disabled():
p = o.payments.first()
@@ -421,6 +427,7 @@ def test_order_create_simulate(token_client, organizer, event, item, quota, ques
],
'total': '21.75',
'comment': '',
'api_meta': {},
"custom_followup_at": None,
'invoice_address': {
'is_business': False,

View File

@@ -291,6 +291,7 @@ TEST_ORDER_RES = {
"payment_provider": "banktransfer",
"total": "23.00",
"comment": "",
"api_meta": {},
"custom_followup_at": None,
"checkin_attention": False,
"checkin_text": None,