mdph13: remove check_status (#31452)
This commit is contained in:
parent
5d3369fd61
commit
48832b135a
|
@ -167,14 +167,6 @@ class MDPH13Resource(BaseResource, HTTPResource):
|
|||
|
||||
return data
|
||||
|
||||
def check_status(self):
|
||||
try:
|
||||
link = Link.objects.latest('created')
|
||||
except Link.DoesNotExist:
|
||||
return
|
||||
# no email passed, it's a background check
|
||||
link.get_file()
|
||||
|
||||
@endpoint(name='link',
|
||||
methods=['post'],
|
||||
description=_('Create link with an extranet account'),
|
||||
|
|
|
@ -263,42 +263,6 @@ def test_call_situation_dossier_with_email_and_ip(mdph13, mock_http):
|
|||
assert headers['X-CD13-IP'] == IP
|
||||
|
||||
|
||||
def test_check_status_no_link(mdph13):
|
||||
assert Link.objects.count() == 0
|
||||
try:
|
||||
mdph13.check_status()
|
||||
except Exception:
|
||||
pytest.fail('check_status() should not raise')
|
||||
|
||||
|
||||
def test_check_status_with_link_nok(mdph13, mock_http):
|
||||
mock_http.add_response({'status_code': 500})
|
||||
Link.objects.create(
|
||||
resource=mdph13,
|
||||
name_id=NAME_ID,
|
||||
file_number=FILE_NUMBER,
|
||||
secret=SECRET,
|
||||
dob=DOB)
|
||||
assert Link.objects.count() == 1
|
||||
with pytest.raises(Exception):
|
||||
mdph13.check_status()
|
||||
|
||||
|
||||
def test_check_status_with_link_ok(mdph13, mock_http):
|
||||
mock_http.add_response(VALID_RESPONSE)
|
||||
Link.objects.create(
|
||||
resource=mdph13,
|
||||
name_id=NAME_ID,
|
||||
file_number=FILE_NUMBER,
|
||||
secret=SECRET,
|
||||
dob=DOB)
|
||||
assert Link.objects.count() == 1
|
||||
try:
|
||||
mdph13.check_status()
|
||||
except Exception:
|
||||
pytest.fail('check_status() should not raise')
|
||||
|
||||
|
||||
def test_link_bad_file_number(mdph13):
|
||||
with pytest.raises(APIError) as e:
|
||||
mdph13.link(request=None, NameID=NAME_ID, numero_dossier='x', secret=None,
|
||||
|
|
Loading…
Reference in New Issue