solis_afi_mss: minor corrections mainly on tests (#47858)

This commit is contained in:
Nicolas Roche 2020-10-19 17:40:44 +02:00
parent ad276bfdc6
commit a3e8a4b3a4
2 changed files with 5 additions and 5 deletions

View File

@ -250,7 +250,7 @@ class SolisAfiMss(BaseResource, HTTPResource):
for record in response['aidesFinancieres']:
record['id'] = record.get('indexAideFinanciere')
record['text'] = '%(dateDemandeAide)s (%(suiviAide)s)' % record
return {'err': 0, 'data': response['aidesFinancieres']}
return {'data': response['aidesFinancieres']}
@endpoint(
display_category=_('Allowance'), display_order=2,

View File

@ -83,8 +83,8 @@ def test_request_error(mocked_get, app, connector, status_code, json_content, a_
connector.request('some-url')
assert exc.value.err
if status_code == 200:
exc.value.http_status == 200
exc.value.args[0] == "invalid JSON content:'%s'" % json_content
assert exc.value.http_status == 200
assert exc.value.args[0] == "invalid JSON content:'%s'" % json_content
else:
assert exc.value.data['status_code'] == status_code
assert exc.value.data['json_content'] == a_dict
@ -155,8 +155,8 @@ def test_search_from_email_error(mocked_get, app, connector):
mocked_get.side_effect = [ERROR]
with pytest.raises(APIError) as exc:
connector.search_from_email('foo@dummy.org')
exc.value.data['status_code'] == 400
exc.value.data['json_content'][0]['message'] == ERROR_MSG
assert exc.value.data['status_code'] == 400
assert exc.value.data['json_content'][0]['message'] == ERROR_MSG
assert mocked_get.mock_calls == [mock.call(
'https://dummy-server.org/afi/agent/rechercherParEmail/',
headers={'Accept': 'application/json'},