mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Added delete endpoint and tests.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from sqlalchemy.exc import DataError
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
from app.dao.users_dao import (save_model_user, get_model_users)
|
||||
from app.dao.users_dao import (
|
||||
save_model_user, get_model_users, delete_model_user)
|
||||
from tests.app.conftest import sample_user as create_sample_user
|
||||
from app.models import User
|
||||
|
||||
@@ -47,3 +48,9 @@ def test_get_user_invalid_id(notify_api, notify_db, notify_db_session):
|
||||
pytest.fail("DataError exception not thrown.")
|
||||
except DataError:
|
||||
pass
|
||||
|
||||
|
||||
def test_delete_users(notify_api, notify_db, notify_db_session, sample_user):
|
||||
assert User.query.count() == 1
|
||||
delete_model_user(sample_user)
|
||||
assert User.query.count() == 0
|
||||
|
||||
Reference in New Issue
Block a user