mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 20:18:38 +02:00
Test for technical contact on its own
This commit is contained in:
parent
f0acb978b9
commit
b824b6725f
2 changed files with 44 additions and 1 deletions
|
@ -663,6 +663,25 @@ class MockEppLib(TestCase):
|
|||
],
|
||||
)
|
||||
|
||||
InfoDomainWithDefaultTechnicalContact = fakedEppObject(
|
||||
"fakepw",
|
||||
cr_date=datetime.datetime(2023, 5, 25, 19, 45, 35),
|
||||
contacts=[
|
||||
common.DomainContact(
|
||||
contact="defaultTech",
|
||||
type=PublicContact.ContactTypeChoices.TECHNICAL,
|
||||
)
|
||||
],
|
||||
hosts=["fake.host.com"],
|
||||
statuses=[
|
||||
common.Status(state="serverTransferProhibited", description="", lang="en"),
|
||||
common.Status(state="inactive", description="", lang="en"),
|
||||
],
|
||||
)
|
||||
|
||||
mockDefaultTechnicalContact = InfoDomainWithContacts.dummyInfoContactResultData(
|
||||
"defaultTech", "dotgov@cisa.dhs.gov"
|
||||
)
|
||||
mockDefaultSecurityContact = InfoDomainWithContacts.dummyInfoContactResultData(
|
||||
"defaultSec", "dotgov@cisa.dhs.gov"
|
||||
)
|
||||
|
@ -702,6 +721,8 @@ class MockEppLib(TestCase):
|
|||
return MagicMock(res_data=[self.InfoDomainWithContacts])
|
||||
elif getattr(_request, "name", None) == "defaultsecurity.gov":
|
||||
return MagicMock(res_data=[self.InfoDomainWithDefaultSecurityContact])
|
||||
elif getattr(_request, "name", None) == "defaulttechnical.gov":
|
||||
return MagicMock(res_data=[self.InfoDomainWithDefaultTechnicalContact])
|
||||
else:
|
||||
return MagicMock(res_data=[self.mockDataInfoDomain])
|
||||
elif isinstance(_request, commands.InfoContact):
|
||||
|
@ -719,6 +740,8 @@ class MockEppLib(TestCase):
|
|||
mocked_result = self.mockRegistrantContact
|
||||
case "defaultSec":
|
||||
mocked_result = self.mockDefaultSecurityContact
|
||||
case "defaultTech":
|
||||
mocked_result = self.mockDefaultTechnicalContact
|
||||
case _:
|
||||
# Default contact return
|
||||
mocked_result = self.mockDataInfoContact
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue