fix unit test

This commit is contained in:
Rachid Mrad 2024-05-17 16:01:15 -04:00
parent b6797c3486
commit a1ff0b63ae
No known key found for this signature in database

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]