mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-05 02:41:14 -05:00
Rename variables and functions in tests
To reflect the new name of the feature.
This commit is contained in:
@@ -13,27 +13,27 @@ from app.dao.service_whitelist_dao import (
|
||||
from tests.app.db import create_service
|
||||
|
||||
|
||||
def test_fetch_service_whitelist_gets_whitelists(sample_service_whitelist):
|
||||
whitelist = dao_fetch_service_guest_list(sample_service_whitelist.service_id)
|
||||
assert len(whitelist) == 1
|
||||
assert whitelist[0].id == sample_service_whitelist.id
|
||||
def test_fetch_service_guest_list_gets_guest_lists(sample_service_guest_list):
|
||||
guest_list = dao_fetch_service_guest_list(sample_service_guest_list.service_id)
|
||||
assert len(guest_list) == 1
|
||||
assert guest_list[0].id == sample_service_guest_list.id
|
||||
|
||||
|
||||
def test_fetch_service_whitelist_ignores_other_service(sample_service_whitelist):
|
||||
def test_fetch_service_guest_list_ignores_other_service(sample_service_guest_list):
|
||||
assert len(dao_fetch_service_guest_list(uuid.uuid4())) == 0
|
||||
|
||||
|
||||
def test_add_and_commit_whitelisted_contacts_saves_data(sample_service):
|
||||
whitelist = ServiceGuestList.from_string(sample_service.id, EMAIL_TYPE, 'foo@example.com')
|
||||
def test_add_and_commit_guest_list_contacts_saves_data(sample_service):
|
||||
guest_list = ServiceGuestList.from_string(sample_service.id, EMAIL_TYPE, 'foo@example.com')
|
||||
|
||||
dao_add_and_commit_guest_list_contacts([whitelist])
|
||||
dao_add_and_commit_guest_list_contacts([guest_list])
|
||||
|
||||
db_contents = ServiceGuestList.query.all()
|
||||
assert len(db_contents) == 1
|
||||
assert db_contents[0].id == whitelist.id
|
||||
assert db_contents[0].id == guest_list.id
|
||||
|
||||
|
||||
def test_remove_service_whitelist_only_removes_for_my_service(notify_db, notify_db_session):
|
||||
def test_remove_service_guest_list_only_removes_for_my_service(notify_db, notify_db_session):
|
||||
service_1 = create_service(service_name="service 1")
|
||||
service_2 = create_service(service_name="service 2")
|
||||
dao_add_and_commit_guest_list_contacts([
|
||||
@@ -47,8 +47,8 @@ def test_remove_service_whitelist_only_removes_for_my_service(notify_db, notify_
|
||||
assert len(service_2.guest_list) == 1
|
||||
|
||||
|
||||
def test_remove_service_whitelist_does_not_commit(notify_db, sample_service_whitelist):
|
||||
dao_remove_service_guest_list(sample_service_whitelist.service_id)
|
||||
def test_remove_service_guest_list_does_not_commit(notify_db, sample_service_guest_list):
|
||||
dao_remove_service_guest_list(sample_service_guest_list.service_id)
|
||||
|
||||
# since dao_remove_service_guest_list doesn't commit, we can still rollback its changes
|
||||
notify_db.session.rollback()
|
||||
|
||||
Reference in New Issue
Block a user