Merge branch 'master' of github.com:alphagov/notifications-api into service-whitelist

This commit is contained in:
Leo Hemsted
2016-09-22 17:18:52 +01:00
9 changed files with 55 additions and 67 deletions

View File

@@ -1,7 +1,8 @@
import uuid
from app.models import ServiceWhitelist
from app.dao.service_whitelist_dao import (#
from app.dao.service_whitelist_dao import (
dao_fetch_service_whitelist,
dao_add_and_commit_whitelisted_contacts,
dao_remove_service_whitelist
@@ -13,9 +14,11 @@ def test_fetch_service_whitelist_gets_whitelists(sample_service_whitelist):
assert len(whitelist) == 1
assert whitelist[0].id == sample_service_whitelist.id
def test_fetch_service_whitelist_ignores_other_service(sample_service_whitelist):
assert len(dao_fetch_service_whitelist(uuid.uuid4())) == 0
def test_add_and_commit_whitelisted_contacts_saves_data(sample_service):
whitelist = ServiceWhitelist.from_string(sample_service.id, 'foo@example.com')
dao_add_and_commit_whitelisted_contacts([whitelist])