mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 00:41:35 -05:00
Added delete endpoint and tests.
This commit is contained in:
@@ -195,3 +195,15 @@ def test_get_user_service_service_not_exists(notify_api, notify_db, notify_db_se
|
||||
assert resp.status_code == 404
|
||||
json_resp = json.loads(resp.get_data(as_text=True))
|
||||
assert "Service not found" in json_resp['message']
|
||||
|
||||
|
||||
def test_delete_user(notify_api, notify_db, notify_db_session, sample_user):
|
||||
with notify_api.test_request_context():
|
||||
with notify_api.test_client() as client:
|
||||
user = User.query.first()
|
||||
resp = client.delete(
|
||||
url_for('user.update_user', user_id=user.id),
|
||||
headers=[('Content-Type', 'application/json')])
|
||||
assert resp.status_code == 202
|
||||
json_resp = json.loads(resp.get_data(as_text=True))
|
||||
assert User.query.count() == 0
|
||||
|
||||
Reference in New Issue
Block a user