mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-18 10:29:23 +02:00
Fix tests in domain requests
This commit is contained in:
parent
be2f7fe020
commit
002cfba35b
2 changed files with 4 additions and 12 deletions
|
@ -103,7 +103,7 @@ class OrganizationContactForm(RegistrarForm):
|
||||||
# it is a federal agency. Use clean to check programatically
|
# it is a federal agency. Use clean to check programatically
|
||||||
# if it has been filled in when required.
|
# if it has been filled in when required.
|
||||||
# uncomment to see if modelChoiceField can be an arg later
|
# uncomment to see if modelChoiceField can be an arg later
|
||||||
# required=False,
|
required=False,
|
||||||
queryset=FederalAgency.objects.all(),
|
queryset=FederalAgency.objects.all(),
|
||||||
empty_label="--Select--",
|
empty_label="--Select--",
|
||||||
# choices=[("", "--Select--")] + DomainRequest.AGENCY_CHOICES,
|
# choices=[("", "--Select--")] + DomainRequest.AGENCY_CHOICES,
|
||||||
|
|
|
@ -180,7 +180,7 @@ class DomainRequestTests(TestWithUser, WebTest):
|
||||||
org_contact_form = org_contact_page.forms[0]
|
org_contact_form = org_contact_page.forms[0]
|
||||||
# federal agency so we have to fill in federal_agency
|
# federal agency so we have to fill in federal_agency
|
||||||
federal_agency, _ = FederalAgency.objects.get_or_create(agency="General Services Administration")
|
federal_agency, _ = FederalAgency.objects.get_or_create(agency="General Services Administration")
|
||||||
org_contact_form["organization_contact-federal_agency"] = federal_agency
|
org_contact_form["organization_contact-federal_agency"] = federal_agency.id
|
||||||
org_contact_form["organization_contact-organization_name"] = "Testorg"
|
org_contact_form["organization_contact-organization_name"] = "Testorg"
|
||||||
org_contact_form["organization_contact-address_line1"] = "address 1"
|
org_contact_form["organization_contact-address_line1"] = "address 1"
|
||||||
org_contact_form["organization_contact-address_line2"] = "address 2"
|
org_contact_form["organization_contact-address_line2"] = "address 2"
|
||||||
|
@ -690,7 +690,6 @@ class DomainRequestTests(TestWithUser, WebTest):
|
||||||
|
|
||||||
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
contact_result = org_contact_form.submit()
|
contact_result = org_contact_form.submit()
|
||||||
|
|
||||||
# the post request should return a redirect to the
|
# the post request should return a redirect to the
|
||||||
# about your organization page if it was successful.
|
# about your organization page if it was successful.
|
||||||
self.assertEqual(contact_result.status_code, 302)
|
self.assertEqual(contact_result.status_code, 302)
|
||||||
|
@ -2023,14 +2022,9 @@ class DomainRequestTests(TestWithUser, WebTest):
|
||||||
org_contact_form = org_contact_page.forms[0]
|
org_contact_form = org_contact_page.forms[0]
|
||||||
# federal agency so we have to fill in federal_agency
|
# federal agency so we have to fill in federal_agency
|
||||||
federal_agency, _ = FederalAgency.objects.get_or_create(agency="General Services Administration")
|
federal_agency, _ = FederalAgency.objects.get_or_create(agency="General Services Administration")
|
||||||
print("!!! org_contact_form displayed", org_contact_form.__dict__)
|
org_contact_form["organization_contact-federal_agency"] = federal_agency.id
|
||||||
print("!!! Federal agency is", federal_agency)
|
|
||||||
org_contact_form["organization_contact-federal_agency"] = "67"
|
|
||||||
# org_contact_form["organization_contact-federal_agency"] = federal_agency
|
|
||||||
org_contact_form["organization_contact-organization_name"] = "Testorg"
|
org_contact_form["organization_contact-organization_name"] = "Testorg"
|
||||||
print("!!! GET PAST Organization name")
|
|
||||||
org_contact_form["organization_contact-address_line1"] = "address 1"
|
org_contact_form["organization_contact-address_line1"] = "address 1"
|
||||||
print("!!! GET PAST Address Line 1")
|
|
||||||
org_contact_form["organization_contact-address_line2"] = "address 2"
|
org_contact_form["organization_contact-address_line2"] = "address 2"
|
||||||
org_contact_form["organization_contact-city"] = "NYC"
|
org_contact_form["organization_contact-city"] = "NYC"
|
||||||
org_contact_form["organization_contact-state_territory"] = "NY"
|
org_contact_form["organization_contact-state_territory"] = "NY"
|
||||||
|
@ -2038,11 +2032,9 @@ class DomainRequestTests(TestWithUser, WebTest):
|
||||||
org_contact_form["organization_contact-urbanization"] = "URB Royal Oaks"
|
org_contact_form["organization_contact-urbanization"] = "URB Royal Oaks"
|
||||||
|
|
||||||
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
print("!!! Before submit")
|
|
||||||
org_contact_result = org_contact_form.submit()
|
org_contact_result = org_contact_form.submit()
|
||||||
|
|
||||||
# ---- AO CONTACT PAGE ----
|
# ---- AO CONTACT PAGE ----
|
||||||
print("!!! After submit")
|
|
||||||
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
ao_page = org_contact_result.follow()
|
ao_page = org_contact_result.follow()
|
||||||
self.assertContains(ao_page, "Executive branch federal agencies")
|
self.assertContains(ao_page, "Executive branch federal agencies")
|
||||||
|
@ -2102,7 +2094,7 @@ class DomainRequestTests(TestWithUser, WebTest):
|
||||||
org_contact_form = org_contact_page.forms[0]
|
org_contact_form = org_contact_page.forms[0]
|
||||||
# federal agency so we have to fill in federal_agency
|
# federal agency so we have to fill in federal_agency
|
||||||
federal_agency, _ = FederalAgency.objects.get_or_create(agency="General Services Administration")
|
federal_agency, _ = FederalAgency.objects.get_or_create(agency="General Services Administration")
|
||||||
org_contact_form["organization_contact-federal_agency"] = federal_agency
|
org_contact_form["organization_contact-federal_agency"] = federal_agency.id
|
||||||
org_contact_form["organization_contact-organization_name"] = "Testorg"
|
org_contact_form["organization_contact-organization_name"] = "Testorg"
|
||||||
org_contact_form["organization_contact-address_line1"] = "address 1"
|
org_contact_form["organization_contact-address_line1"] = "address 1"
|
||||||
org_contact_form["organization_contact-address_line2"] = "address 2"
|
org_contact_form["organization_contact-address_line2"] = "address 2"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue