From 48832b135a2b67bfbfe4f9bceab38a99822b77e9 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Fri, 15 Mar 2019 13:36:21 +0100 Subject: [PATCH] mdph13: remove check_status (#31452) --- passerelle/contrib/mdph13/models.py | 8 ------- tests/test_mdph13.py | 36 ----------------------------- 2 files changed, 44 deletions(-) diff --git a/passerelle/contrib/mdph13/models.py b/passerelle/contrib/mdph13/models.py index 60e2059..8ce1bbc 100644 --- a/passerelle/contrib/mdph13/models.py +++ b/passerelle/contrib/mdph13/models.py @@ -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'), diff --git a/tests/test_mdph13.py b/tests/test_mdph13.py index 934e9a0..c788cbd 100644 --- a/tests/test_mdph13.py +++ b/tests/test_mdph13.py @@ -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, -- 2.20.1