Merge pull request #2786 from alphagov/flag-dwp

Flag go live requests from DWP
This commit is contained in:
Chris Hill-Scott
2019-02-19 12:01:07 +00:00
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@@ -440,6 +440,8 @@ class AgreementInfo:
@property
def as_human_readable(self):
if self.canonical_domain and 'dwp' in self.canonical_domain:
return 'DWP - Requires OED approval'
if self.agreement_signed:
return 'Yes, on behalf of {}'.format(self.owner)
elif self.owner:

View File

@@ -305,6 +305,18 @@ def test_get_valid_agreement_info_known_details(domain_or_email_address):
)
@pytest.mark.parametrize("domain_or_email_address", (
"test@dwp.gov.uk", "test@dwp.gsi.gov.uk",
))
def test_dwp_go_live_requests_are_flagged(domain_or_email_address):
agreement_info = AgreementInfo(domain_or_email_address)
assert agreement_info.owner == "Department for Work and Pensions"
assert agreement_info.agreement_signed is True
assert agreement_info.as_human_readable == (
'DWP - Requires OED approval'
)
@pytest.mark.parametrize("domain_or_email_address, is_canonical", (
("test@dclgdatamart.co.uk", False),
("test@communities.gsi.gov.uk", False),