mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-21 10:16:13 +02:00
fix test + lint
This commit is contained in:
parent
b05a62ecd1
commit
7cdfb7a35f
2 changed files with 10 additions and 9 deletions
|
@ -43,9 +43,6 @@ class RequestingEntityForm(RegistrarForm):
|
|||
required=False,
|
||||
queryset=Suborganization.objects.none(),
|
||||
empty_label="--Select--",
|
||||
error_messages={
|
||||
"required": ("Requesting entity is required.")
|
||||
},
|
||||
)
|
||||
requested_suborganization = forms.CharField(
|
||||
label="Requested suborganization",
|
||||
|
@ -118,13 +115,13 @@ class RequestingEntityForm(RegistrarForm):
|
|||
if is_requesting_new_suborganization:
|
||||
# Validate custom suborganization fields
|
||||
if not cleaned_data.get("requested_suborganization"):
|
||||
self.add_error("requested_suborganization", "Enter details for your organization name.")
|
||||
self.add_error("requested_suborganization", "Organization name is required.")
|
||||
if not cleaned_data.get("suborganization_city"):
|
||||
self.add_error("suborganization_city", "Enter details for your city.")
|
||||
self.add_error("suborganization_city", "City is required.")
|
||||
if not cleaned_data.get("suborganization_state_territory"):
|
||||
self.add_error("suborganization_state_territory", "Enter details for your state or territory.")
|
||||
self.add_error("suborganization_state_territory", "State or territory is required.")
|
||||
elif not suborganization:
|
||||
self.add_error("sub_organization", "Select a suborganization.")
|
||||
self.add_error("sub_organization", "Suborganization is required.")
|
||||
|
||||
return cleaned_data
|
||||
|
||||
|
@ -138,6 +135,7 @@ class RequestingEntityYesNoForm(BaseYesNoForm):
|
|||
# IMPORTANT: This is tied to DomainRequest.is_requesting_new_suborganization().
|
||||
# This is due to the from_database method on DomainRequestWizard.
|
||||
field_name = "requesting_entity_is_suborganization"
|
||||
required_error_message = "Requesting entity is required."
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Extend the initialization of the form from RegistrarForm __init__"""
|
||||
|
|
|
@ -1689,7 +1689,7 @@ class TestDomainRequestAdmin(MockEppLib):
|
|||
request.user = self.staffuser
|
||||
|
||||
readonly_fields = self.admin.get_readonly_fields(request)
|
||||
|
||||
self.maxDiff = None
|
||||
expected_fields = [
|
||||
"other_contacts",
|
||||
"current_websites",
|
||||
|
@ -1709,6 +1709,9 @@ class TestDomainRequestAdmin(MockEppLib):
|
|||
"cisa_representative_first_name",
|
||||
"cisa_representative_last_name",
|
||||
"cisa_representative_email",
|
||||
"requested_suborganization",
|
||||
"suborganization_city",
|
||||
"suborganization_state_territory",
|
||||
]
|
||||
self.assertEqual(readonly_fields, expected_fields)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue