Merge pull request #2188 from cisagov/hotfix-agency-name

Remove widget def for agency name to fix form input on domain manage agency form
This commit is contained in:
Rachid Mrad 2024-05-21 13:19:10 -04:00 committed by GitHub
commit de2d3514eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 5 deletions

View file

@ -385,7 +385,6 @@ class DomainOrgNameAddressForm(forms.ModelForm):
# because for this fields we are creating an individual
# instance of the Select. For the other fields we use the for loop to set
# the class's required attribute to true.
"federal_agency": forms.TextInput,
"organization_name": forms.TextInput,
"address_line1": forms.TextInput,
"address_line2": forms.TextInput,

View file

@ -1447,7 +1447,7 @@ class TestDomainOrganization(TestDomainOverview):
session_id = self.app.cookies[settings.SESSION_COOKIE_NAME]
org_name_page.form["federal_agency"] = "Department of State"
org_name_page.form["federal_agency"] = FederalAgency.objects.filter(agency="Department of State").get().id
org_name_page.form["city"] = "Faketown"
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
@ -1456,9 +1456,8 @@ class TestDomainOrganization(TestDomainOverview):
success_result_page = org_name_page.form.submit()
self.assertEqual(success_result_page.status_code, 200)
# Check for the old and new value
self.assertContains(success_result_page, federal_agency.id)
self.assertNotContains(success_result_page, "Department of State")
# Check that the agency has not changed
self.assertEqual(self.domain_information.federal_agency.agency, "AMTRAK")
# Do another check on the form itself
form = success_result_page.forms[0]