toulouse_axel: Forbid blank NameID for invoices endpoint (#66974)
This commit is contained in:
parent
a9449c0e51
commit
ed9a4a2986
|
@ -747,7 +747,7 @@ class ToulouseAxel(BaseResource):
|
|||
example_pattern='{regie_id}/invoices',
|
||||
description=_("Get invoices to pay"),
|
||||
parameters={
|
||||
'NameID': {'description': _('Publik ID')},
|
||||
'NameID': {'description': _('Publik ID'), 'blank': False},
|
||||
'regie_id': {'description': _('Regie identifier'), 'example_value': '42-PERISCOL'},
|
||||
},
|
||||
)
|
||||
|
|
|
@ -2063,6 +2063,10 @@ def test_invoices_endpoint_axel_error(app, resource):
|
|||
assert resp.json['err_desc'] == "Axel error: FooBar"
|
||||
assert resp.json['err'] == 'error'
|
||||
|
||||
resp = app.get('/toulouse-axel/test/regie/MAREGIE/invoices?NameID=', status=400)
|
||||
assert 'InvalidParameterValue' in resp.json['err_class']
|
||||
assert resp.json['err'] == 1
|
||||
|
||||
|
||||
def test_invoices_endpoint_no_result(app, resource):
|
||||
resp = app.get('/toulouse-axel/test/regie/MAREGIE/invoices?NameID=yyy')
|
||||
|
|
Loading…
Reference in New Issue