mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 15:48:24 -04:00
Merge pull request #2072 from alphagov/test-domains
Check that all domains in our lists are valid
This commit is contained in:
@@ -5,10 +5,12 @@ from pathlib import Path
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
|
from notifications_utils.recipients import validate_email_address
|
||||||
|
|
||||||
from app import format_datetime_relative
|
from app import format_datetime_relative
|
||||||
from app.utils import (
|
from app.utils import (
|
||||||
AgreementInfo,
|
AgreementInfo,
|
||||||
|
GovernmentEmailDomain,
|
||||||
Spreadsheet,
|
Spreadsheet,
|
||||||
email_safe,
|
email_safe,
|
||||||
generate_next_dict,
|
generate_next_dict,
|
||||||
@@ -456,6 +458,8 @@ def test_validate_government_domain_data():
|
|||||||
|
|
||||||
for domain in AgreementInfo.domains.keys():
|
for domain in AgreementInfo.domains.keys():
|
||||||
|
|
||||||
|
validate_email_address('test@{}'.format(domain))
|
||||||
|
|
||||||
agreement_info = AgreementInfo(domain)
|
agreement_info = AgreementInfo(domain)
|
||||||
|
|
||||||
assert agreement_info.crown_status in {
|
assert agreement_info.crown_status in {
|
||||||
@@ -473,6 +477,12 @@ def test_validate_government_domain_data():
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def test_validate_email_domain_data():
|
||||||
|
|
||||||
|
for domain in GovernmentEmailDomain.domains.keys():
|
||||||
|
validate_email_address('test@{}'.format(domain))
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('time, human_readable_datetime', [
|
@pytest.mark.parametrize('time, human_readable_datetime', [
|
||||||
('2018-03-14 09:00', '14 March at 9:00am'),
|
('2018-03-14 09:00', '14 March at 9:00am'),
|
||||||
('2018-03-14 15:00', '14 March at 3:00pm'),
|
('2018-03-14 15:00', '14 March at 3:00pm'),
|
||||||
|
|||||||
Reference in New Issue
Block a user