mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 02:36:02 +02:00
Fix unit tests
This commit is contained in:
parent
9a747fbdc5
commit
f32aa9e18a
3 changed files with 11 additions and 8 deletions
|
@ -1951,6 +1951,7 @@ class Domain(TimeStampedModel, DomainHelper):
|
||||||
# Does the item we're grabbing match
|
# Does the item we're grabbing match
|
||||||
# what we have in our DB?
|
# what we have in our DB?
|
||||||
if existing_contact.email != public_contact.email or existing_contact.registry_id != public_contact.registry_id:
|
if existing_contact.email != public_contact.email or existing_contact.registry_id != public_contact.registry_id:
|
||||||
|
print("******* IN IF STATEMENT!!!!! ***********")
|
||||||
existing_contact.delete()
|
existing_contact.delete()
|
||||||
public_contact.save()
|
public_contact.save()
|
||||||
logger.warning("Requested PublicContact is out of sync " "with DB.")
|
logger.warning("Requested PublicContact is out of sync " "with DB.")
|
||||||
|
|
|
@ -1058,13 +1058,13 @@ class MockEppLib(TestCase):
|
||||||
],
|
],
|
||||||
ex_date=date(2023, 11, 15),
|
ex_date=date(2023, 11, 15),
|
||||||
)
|
)
|
||||||
mockDataInfoContact = mockDataInfoDomain.dummyInfoContactResultData(
|
# mockDataInfoContact = mockDataInfoDomain.dummyInfoContactResultData(
|
||||||
id="SECURITY", email="security@mail.gov", cr_date=datetime(2023, 5, 25, 19, 45, 35), pw="lastPw"
|
# id="SECURITY", email="security@mail.gov", cr_date=datetime(2023, 5, 25, 19, 45, 35), pw="lastPw"
|
||||||
)
|
# )
|
||||||
mockDataSecurityContact = mockDataInfoDomain.dummyInfoContactResultData(
|
mockDataSecurityContact = mockDataInfoDomain.dummyInfoContactResultData(
|
||||||
id="SECURITY", email="security@mail.gov", cr_date=datetime(2023, 5, 25, 19, 45, 35), pw="lastPw"
|
id="securityContact", email="security@mail.gov", cr_date=datetime(2023, 5, 25, 19, 45, 35), pw="lastPw"
|
||||||
)
|
)
|
||||||
print("!! mockDataInfoContact is", mockDataInfoContact)
|
# print("!! mockDataInfoContact is", mockDataInfoContact)
|
||||||
InfoDomainWithContacts = fakedEppObject(
|
InfoDomainWithContacts = fakedEppObject(
|
||||||
"fakePw",
|
"fakePw",
|
||||||
cr_date=make_aware(datetime(2023, 5, 25, 19, 45, 35)),
|
cr_date=make_aware(datetime(2023, 5, 25, 19, 45, 35)),
|
||||||
|
|
|
@ -213,14 +213,16 @@ class TestDomainCache(MockEppLib):
|
||||||
self.mockDataSecurityContact.id,
|
self.mockDataSecurityContact.id,
|
||||||
security,
|
security,
|
||||||
)
|
)
|
||||||
print("self.mockDataInfoContact.id is", self.mockDataInfoContact.id)
|
# print("self.mockDataInfoContact.id is", self.mockDataInfoContact.id)
|
||||||
|
print("self.mockDataSecurityContact", self.mockDataSecurityContact)
|
||||||
print("self.mockDataSecurityContact.id is", self.mockDataSecurityContact.id)
|
print("self.mockDataSecurityContact.id is", self.mockDataSecurityContact.id)
|
||||||
|
print("mapped is", mapped)
|
||||||
|
|
||||||
# id and registry_id are the same thing
|
# id and registry_id are the same thing
|
||||||
expected_contact = PublicContact(
|
expected_contact = PublicContact(
|
||||||
domain=domain,
|
domain=domain,
|
||||||
contact_type=security,
|
contact_type=security,
|
||||||
registry_id="SECURITY", # self.mockDataInfoContact.id
|
registry_id="securityContact", # self.mockDataInfoContact.id
|
||||||
email="security@mail.gov",
|
email="security@mail.gov",
|
||||||
voice="+1.8882820870",
|
voice="+1.8882820870",
|
||||||
fax="+1-212-9876543",
|
fax="+1-212-9876543",
|
||||||
|
@ -253,7 +255,7 @@ class TestDomainCache(MockEppLib):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
!!! db_object is Registry Customer Service <123@mail.gov>id: 123 type: security
|
!!! db_object is Registry Customer Service <123@mail.gov>id: 123 type: security
|
||||||
!!! in_db is Registry Customer Service <security@mail.gov>id: securityContact type: security
|
!!! in_db is Registry Customer Service <123@mail.gov>id: securityContact type: security
|
||||||
"""
|
"""
|
||||||
print("!!! domain.security_contact.registry_id ", domain.security_contact.registry_id)
|
print("!!! domain.security_contact.registry_id ", domain.security_contact.registry_id)
|
||||||
print("!!! db_object is", db_object)
|
print("!!! db_object is", db_object)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue