Fix unit tests

This commit is contained in:
zandercymatics 2025-01-28 14:36:40 -07:00
parent ad79557a55
commit 0478d2bee6
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
6 changed files with 97 additions and 53 deletions

View file

@ -1300,8 +1300,6 @@ class DomainRequest(TimeStampedModel):
.filter(agency=self.federal_agency)
.exists()
)
# NOTE: Shouldn't this be an AND on all required fields?
return (
self.federal_agency is not None
or self.organization_name is not None
@ -1312,6 +1310,17 @@ class DomainRequest(TimeStampedModel):
or self.urbanization is not None
)
def unlock_other_contacts(self) -> bool:
"""Unlocks the other contacts step"""
other_contacts_filled_out = self.other_contacts.filter(
first_name__isnull=False,
last_name__isnull=False,
title__isnull=False,
email__isnull=False,
phone__isnull=False,
).exists()
return (self.has_other_contacts() and other_contacts_filled_out) or self.no_other_contacts_rationale is not None
# ## Form policies ## #
#
# These methods control what questions need to be answered by applicants