mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
add delete functions for inbound and callback api objects
Both service api tasks work fine if the object is unexpectedly deleted halfway through - they both check to see if the api details are still in the DB before trying to send the request.
This commit is contained in:
@@ -1106,7 +1106,7 @@ def admin_request(client):
|
||||
url_for(endpoint, **(endpoint_kwargs or {})),
|
||||
headers=[create_authorization_header()]
|
||||
)
|
||||
json_resp = json.loads(resp.get_data(as_text=True))
|
||||
json_resp = resp.json
|
||||
assert resp.status_code == _expected_status
|
||||
return json_resp
|
||||
|
||||
@@ -1118,7 +1118,7 @@ def admin_request(client):
|
||||
headers=[('Content-Type', 'application/json'), create_authorization_header()]
|
||||
)
|
||||
if resp.get_data():
|
||||
json_resp = json.loads(resp.get_data(as_text=True))
|
||||
json_resp = resp.json
|
||||
else:
|
||||
json_resp = None
|
||||
assert resp.status_code == _expected_status
|
||||
@@ -1130,7 +1130,10 @@ def admin_request(client):
|
||||
url_for(endpoint, **(endpoint_kwargs or {})),
|
||||
headers=[create_authorization_header()]
|
||||
)
|
||||
json_resp = json.loads(resp.get_data(as_text=True))
|
||||
if resp.get_data():
|
||||
json_resp = resp.json
|
||||
else:
|
||||
json_resp = None
|
||||
assert resp.status_code == _expected_status, json_resp
|
||||
return json_resp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user