mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Added delete endpoint and tests.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import pytest
|
||||
from app.dao.services_dao import (
|
||||
save_model_service, get_model_services, DAOException)
|
||||
save_model_service, get_model_services, DAOException, delete_model_service)
|
||||
from tests.app.conftest import sample_service as create_sample_service
|
||||
from app.models import Service
|
||||
|
||||
@@ -62,3 +62,9 @@ def test_missing_user_attribute(notify_api, notify_db, notify_db_session):
|
||||
pytest.fail("DAOException not thrown")
|
||||
except DAOException as e:
|
||||
assert "Missing data for required attribute" in str(e)
|
||||
|
||||
|
||||
def test_delete_service(notify_api, notify_db, notify_db_session, sample_service):
|
||||
assert Service.query.count() == 1
|
||||
delete_model_service(sample_service)
|
||||
assert Service.query.count() == 0
|
||||
|
||||
Reference in New Issue
Block a user