mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 17:45:41 -04:00
Update tests to focus on US numbers
This commit is contained in:
@@ -22,8 +22,8 @@ def test_get_guest_list_returns_data(client, sample_service_guest_list):
|
||||
def test_get_guest_list_separates_emails_and_phones(client, sample_service):
|
||||
dao_add_and_commit_guest_list_contacts([
|
||||
ServiceGuestList.from_string(sample_service.id, EMAIL_TYPE, 'service@example.com'),
|
||||
ServiceGuestList.from_string(sample_service.id, MOBILE_TYPE, '07123456789'),
|
||||
ServiceGuestList.from_string(sample_service.id, MOBILE_TYPE, '+1800-555-555'),
|
||||
ServiceGuestList.from_string(sample_service.id, MOBILE_TYPE, '2028675309'),
|
||||
ServiceGuestList.from_string(sample_service.id, MOBILE_TYPE, '+1800-555-5555'),
|
||||
])
|
||||
|
||||
response = client.get(
|
||||
@@ -32,7 +32,7 @@ def test_get_guest_list_separates_emails_and_phones(client, sample_service):
|
||||
assert response.status_code == 200
|
||||
json_resp = json.loads(response.get_data(as_text=True))
|
||||
assert json_resp['email_addresses'] == ['service@example.com']
|
||||
assert sorted(json_resp['phone_numbers']) == sorted(['+1800-555-555', '07123456789'])
|
||||
assert sorted(json_resp['phone_numbers']) == sorted(['+1800-555-5555', '2028675309'])
|
||||
|
||||
|
||||
def test_get_guest_list_404s_with_unknown_service_id(client):
|
||||
@@ -57,7 +57,7 @@ def test_get_guest_list_returns_no_data(client, sample_service):
|
||||
def test_update_guest_list_replaces_old_guest_list(client, sample_service_guest_list):
|
||||
data = {
|
||||
'email_addresses': ['foo@bar.com'],
|
||||
'phone_numbers': ['07123456789']
|
||||
'phone_numbers': ['2028765309']
|
||||
}
|
||||
|
||||
response = client.put(
|
||||
@@ -69,7 +69,7 @@ def test_update_guest_list_replaces_old_guest_list(client, sample_service_guest_
|
||||
assert response.status_code == 204
|
||||
guest_list = ServiceGuestList.query.order_by(ServiceGuestList.recipient).all()
|
||||
assert len(guest_list) == 2
|
||||
assert guest_list[0].recipient == '07123456789'
|
||||
assert guest_list[0].recipient == '2028765309'
|
||||
assert guest_list[1].recipient == 'foo@bar.com'
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ def test_update_guest_list_doesnt_remove_old_guest_list_if_error(client, sample_
|
||||
|
||||
data = {
|
||||
'email_addresses': [''],
|
||||
'phone_numbers': ['07123456789']
|
||||
'phone_numbers': ['2028675309']
|
||||
}
|
||||
|
||||
response = client.put(
|
||||
|
||||
Reference in New Issue
Block a user