lint + test

This commit is contained in:
zandercymatics 2024-11-13 10:00:07 -07:00
parent e4e1d71526
commit 192e499953
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 11 additions and 4 deletions

View file

@ -119,7 +119,10 @@ class RequestingEntityForm(RegistrarForm):
if not cleaned_data.get("suborganization_city"):
self.add_error("suborganization_city", "Enter the city where your suborganization is located.")
if not cleaned_data.get("suborganization_state_territory"):
self.add_error("suborganization_state_territory", "Select the state, territory, or military post where your suborganization is located")
self.add_error(
"suborganization_state_territory",
"Select the state, territory, or military post where your suborganization is located",
)
elif not suborganization:
self.add_error("sub_organization", "Suborganization is required.")

View file

@ -1794,9 +1794,13 @@ class TestRequestingEntity(WebTest):
form["portfolio_requesting_entity-is_requesting_new_suborganization"] = True
response = form.submit()
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
self.assertContains(response, "Requested suborganization is required.", status_code=200)
self.assertContains(response, "City is required.", status_code=200)
self.assertContains(response, "State, territory, or military post is required.", status_code=200)
self.assertContains(response, "Enter the name of your suborganization.", status_code=200)
self.assertContains(response, "Enter the city where your suborganization is located.", status_code=200)
self.assertContains(
response,
"Select the state, territory, or military post where your suborganization is located",
status_code=200,
)
@override_flag("organization_feature", active=True)
@override_flag("organization_requests", active=True)