api: set cancell_callback_url on invoice (#88590)
This commit is contained in:
parent
c4d2dc9d35
commit
1731fdd2e9
|
@ -261,6 +261,7 @@ class DraftInvoiceSerializer(serializers.ModelSerializer):
|
|||
'payer_address',
|
||||
'payer_demat',
|
||||
'payment_callback_url',
|
||||
'cancel_callback_url',
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -1940,6 +1940,7 @@ def test_add_draft_invoice(app, user):
|
|||
'payer_last_name': 'Last',
|
||||
'payer_address': '41 rue des kangourous\n99999 Kangourou Ville',
|
||||
'payment_callback_url': 'http://payment.com',
|
||||
'cancel_callback_url': 'http://cancel.com',
|
||||
}
|
||||
if demat is not None:
|
||||
params['payer_demat'] = demat
|
||||
|
@ -1962,6 +1963,7 @@ def test_add_draft_invoice(app, user):
|
|||
assert invoice.payer_direct_debit is False
|
||||
assert invoice.pool is None
|
||||
assert invoice.payment_callback_url == 'http://payment.com'
|
||||
assert invoice.cancel_callback_url == 'http://cancel.com'
|
||||
assert invoice.lines.count() == 0
|
||||
|
||||
|
||||
|
@ -2135,6 +2137,7 @@ def test_close_draft_invoice(app, user):
|
|||
payer_demat=random.choice([True, False]),
|
||||
payer_direct_debit=random.choice([True, False]),
|
||||
payment_callback_url='http://payment.com',
|
||||
cancel_callback_url='http://cancel.com',
|
||||
)
|
||||
line = DraftInvoiceLine.objects.create(
|
||||
event_date=datetime.date(2023, 4, 21),
|
||||
|
@ -2169,6 +2172,7 @@ def test_close_draft_invoice(app, user):
|
|||
assert final_invoice.number == 1
|
||||
assert final_invoice.formatted_number == 'F%02d-%s-0000001' % (regie.pk, today.strftime('%y-%m'))
|
||||
assert final_invoice.payment_callback_url == 'http://payment.com'
|
||||
assert final_invoice.cancel_callback_url == 'http://cancel.com'
|
||||
|
||||
final_line = InvoiceLine.objects.order_by('pk')[0]
|
||||
assert final_line.event_date == line.event_date
|
||||
|
|
Loading…
Reference in New Issue