misc: mark some basic data sources endpoint with datasource parameter (#79706) #322
|
@ -148,15 +148,15 @@ class MDEL(BaseResource):
|
|||
return {'data': status}
|
||||
|
||||
@endpoint()
|
||||
def applicants(self, request, without=''):
|
||||
def applicants(self, request, without='', datasource=True):
|
||||
return {'data': [item for item in APPLICANTS if item.get('id') not in without.split(',')]}
|
||||
|
||||
@endpoint()
|
||||
def certificates(self, request):
|
||||
def certificates(self, request, datasource=True):
|
||||
return {'data': CERTIFICATES}
|
||||
|
||||
@endpoint(name='certificate-types')
|
||||
def certificate_types(self, request, without=''):
|
||||
def certificate_types(self, request, without='', datasource=True):
|
||||
return {'data': [item for item in CERTIFICATE_TYPES if item.get('id') not in without.split(',')]}
|
||||
|
||||
@property
|
||||
|
|
|
@ -61,7 +61,7 @@ class LilleUrbanCard(BaseResource):
|
|||
raise TokenError(response['erreur'])
|
||||
return response['token']
|
||||
|
||||
@endpoint(description=_('List of socioprofessional categories'), perm='OPEN')
|
||||
@endpoint(description=_('List of socioprofessional categories'), perm='OPEN', datasource=True)
|
||||
def csp(self, request, *args, **kwargs):
|
||||
return {
|
||||
'data': [
|
||||
|
|
|
@ -105,6 +105,15 @@ def test_csp(app, connector):
|
|||
resp = app.get(endpoint)
|
||||
assert resp.json.get('data')
|
||||
|
||||
resp = app.get(endpoint + '?q=com')
|
||||
assert len(resp.json.get('data')) == 1
|
||||
|
||||
resp = app.get(endpoint + '?id=4')
|
||||
assert len(resp.json.get('data')) == 1
|
||||
|
||||
resp = app.get(endpoint + '?id=24')
|
||||
assert len(resp.json.get('data')) == 0
|
||||
|
||||
|
||||
def test_card_request(app, connector):
|
||||
endpoint = tests.utils.generic_endpoint_url('lille-urban-card', 'card_request', slug=connector.slug)
|
||||
|
|
Loading…
Reference in New Issue