From 3be3dddbbc5ae1fef3368082219fc1a2b8895d66 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Mon, 23 Jan 2023 16:45:15 -0500 Subject: [PATCH 1/9] Add all dotgov example text to domain_example include --- .../templates/includes/domain_example.html | 94 +++++++++++++++++++ .../includes/domain_example__city.html | 15 --- 2 files changed, 94 insertions(+), 15 deletions(-) create mode 100644 src/registrar/templates/includes/domain_example.html delete mode 100644 src/registrar/templates/includes/domain_example__city.html diff --git a/src/registrar/templates/includes/domain_example.html b/src/registrar/templates/includes/domain_example.html new file mode 100644 index 000000000..ed9ee7504 --- /dev/null +++ b/src/registrar/templates/includes/domain_example.html @@ -0,0 +1,94 @@ +{% if is_federal %} + {% if federal_type == 'executive' %} +

Examples:

+ + + {% elif federal_type == 'judicial' %} +

Examples:

+

+

+

+ + {% elif federal_type == 'legislative' %} +

Examples:

+ +{% endif %} + +{% elif organization_type == 'interstate' %} +

Examples:

+ + +{% elif organization_type == 'state_or_territory' %} +

State .gov domains must include the two-letter state abbreviation or clearly spell out the state name.

+

Examples:

+ + +{% elif organization_type == 'tribal' %} +

Tribal domains may include the suffix -nsn, for native sovereign nation.

+

Examples:

+ + +{% elif organization_type == 'county' %} +

Most county .gov domains must include the two-letter state abbreviation or the full state name. County names that aren’t shared by any other city, county, parish, town, borough, village or equivalent in the U.S., at the time a domain is granted, can be requested without referring to the state. Counties can include “county” in their domain to distinguish it from other places with similar names. We use the Census Bureau’s National Places Gazetteer Files to determine if county names are unique.

+

Examples:

+ + +{% elif organization_type == 'city' %} +

Most city domains must include the two-letter state abbreviation or clearly spell out the state name. Using phrases like “City of” or “Town of” is optional.

+

Examples:

+ +

Some cities don’t have to refer to their state. +

+

+ +{% elif organization_type == 'special_district' %} +

Domain names must represent your organization or institutional name, not solely the services you provide. It also needs to include your two-letter state abbreviation or clearly spell out the state name.

+

Examples:

+ + +{% elif organization_type == 'school_district' %} +

Domain names must represent your organization or institutional name.

+

Example: mckinneyISDTX.gov

+ + +{%endif %} + diff --git a/src/registrar/templates/includes/domain_example__city.html b/src/registrar/templates/includes/domain_example__city.html deleted file mode 100644 index 438ea005d..000000000 --- a/src/registrar/templates/includes/domain_example__city.html +++ /dev/null @@ -1,15 +0,0 @@ -

Most city domains must include the two-letter state abbreviation or clearly spell out the state name. Using phrases like “City of” or “Town of” is optional.

-

Examples: -

-

-

Some cities don’t have to refer to their state. -

-

From fc59e0b9cf3f5485de415a8376cd3b0ebef96a38 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Mon, 23 Jan 2023 16:50:13 -0500 Subject: [PATCH 2/9] Move is_federal to base class --- src/registrar/views/application.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/registrar/views/application.py b/src/registrar/views/application.py index a53fb51cf..11609e7b8 100644 --- a/src/registrar/views/application.py +++ b/src/registrar/views/application.py @@ -264,6 +264,7 @@ class ApplicationWizard(LoginRequiredMixin, TemplateView): "steps": self.steps, # Add information about which steps should be unlocked "visited": self.storage.get("step_history", []), + "is_federal": self.application.is_federal(), } def get_step_list(self) -> list: @@ -350,11 +351,6 @@ class OrganizationContact(ApplicationWizard): template_name = "application_org_contact.html" forms = [forms.OrganizationContactForm] - def get_context_data(self): - context = super().get_context_data() - context["is_federal"] = self.application.is_federal() - return context - class TypeOfWork(ApplicationWizard): template_name = "application_type_of_work.html" @@ -367,7 +363,6 @@ class AuthorizingOfficial(ApplicationWizard): def get_context_data(self): context = super().get_context_data() - context["is_federal"] = self.application.is_federal() context["organization_type"] = self.application.organization_type context["federal_type"] = self.application.federal_type return context @@ -382,6 +377,12 @@ class DotgovDomain(ApplicationWizard): template_name = "application_dotgov_domain.html" forms = [forms.DotGovDomainForm] + def get_context_data(self): + context = super().get_context_data() + context["organization_type"] = self.application.organization_type + context["federal_type"] = self.application.federal_type + return context + class Purpose(ApplicationWizard): template_name = "application_purpose.html" From 4e45f113c19cfb044421e5ce3ba29d493317ae12 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Mon, 23 Jan 2023 16:51:16 -0500 Subject: [PATCH 3/9] Update include file path in the dotgov domain page template --- src/registrar/templates/application_dotgov_domain.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/templates/application_dotgov_domain.html b/src/registrar/templates/application_dotgov_domain.html index 4225764e5..cd869abca 100644 --- a/src/registrar/templates/application_dotgov_domain.html +++ b/src/registrar/templates/application_dotgov_domain.html @@ -18,7 +18,7 @@

Here are a few domain examples for your type of organization.

- {% include "includes/domain_example__city.html" %} + {% include "includes/domain_example.html" %}
From 45dcc07be85547b6ba212a420d736cee174bf4b7 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Mon, 23 Jan 2023 17:13:33 -0500 Subject: [PATCH 4/9] Add test for dynamic text on dotgov domain page --- src/registrar/tests/test_views.py | 97 +++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index 378341295..32973d0cf 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -804,6 +804,103 @@ class DomainApplicationTests(TestWithUser, WebTest): ao_page = election_page.click(str(self.TITLES["authorizing_official"]), index=0) self.assertContains(ao_page, "Domain requests from cities") + def test_application_dotgov_domain_dynamic_text(self): + type_page = self.app.get(reverse("application:")).follow() + # django-webtest does not handle cookie-based sessions well because it keeps + # resetting the session key on each new request, thus destroying the concept + # of a "session". We are going to do it manually, saving the session ID here + # and then setting the cookie on each request. + session_id = self.app.cookies[settings.SESSION_COOKIE_NAME] + + # ---- TYPE PAGE ---- + type_form = type_page.form + type_form["organization_type-organization_type"] = "federal" + + # test next button + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + type_result = type_page.form.submit() + + # ---- FEDERAL BRANCH PAGE ---- + # Follow the redirect to the next form page + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + federal_page = type_result.follow() + federal_form = federal_page.form + federal_form["organization_federal-federal_type"] = "executive" + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + federal_result = federal_form.submit() + + # ---- ORG CONTACT PAGE ---- + # Follow the redirect to the next form page + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + org_contact_page = federal_result.follow() + org_contact_form = org_contact_page.form + # federal agency so we have to fill in federal_agency + org_contact_form[ + "organization_contact-federal_agency" + ] = "General Services Administration" + org_contact_form["organization_contact-organization_name"] = "Testorg" + org_contact_form["organization_contact-address_line1"] = "address 1" + org_contact_form["organization_contact-address_line2"] = "address 2" + org_contact_form["organization_contact-city"] = "NYC" + org_contact_form["organization_contact-state_territory"] = "NY" + org_contact_form["organization_contact-zipcode"] = "10002" + org_contact_form["organization_contact-urbanization"] = "URB Royal Oaks" + + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + org_contact_result = org_contact_form.submit() + + # ---- AO CONTACT PAGE ---- + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + ao_page = org_contact_result.follow() + + # ---- AUTHORIZING OFFICIAL PAGE ---- + # Follow the redirect to the next form page + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + ao_page = org_contact_result.follow() + ao_form = ao_page.form + ao_form["authorizing_official-first_name"] = "Testy ATO" + ao_form["authorizing_official-last_name"] = "Tester ATO" + ao_form["authorizing_official-title"] = "Chief Tester" + ao_form["authorizing_official-email"] = "testy@town.com" + ao_form["authorizing_official-phone"] = "(201) 555 5555" + + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + ao_result = ao_form.submit() + + # ---- CURRENT SITES PAGE ---- + # Follow the redirect to the next form page + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + current_sites_page = ao_result.follow() + current_sites_form = current_sites_page.form + current_sites_form["current_sites-current_site"] = "www.city.com" + + # test saving the page + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + current_sites_result = current_sites_form.submit() + + # ---- DOTGOV DOMAIN PAGE ---- + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + dotgov_page = current_sites_result.follow() + dotgov_form = dotgov_page.form + + self.assertContains(dotgov_page, "medicare.gov") + + # Go back to organization type page and change type + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + dotgov_page.click(str(self.TITLES["organization_type"]), index=0) + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + type_form["organization_type-organization_type"] = "city" + type_result = type_form.submit() + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + election_page = type_result.follow() + + # Go back to dotgov domain page to test the dynamic text changed + self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) + dotgov_page = election_page.click(str(self.TITLES["dotgov_domain"]), index=0) + self.assertContains(dotgov_page, "BlufftonIndiana.gov") + self.assertNotContains(dotgov_page, "medicare.gov") + + @skip("WIP") def test_application_edit_restore(self): """ From e0a571bb69e75c0bc926d56c953add11e87240a5 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Mon, 23 Jan 2023 17:46:48 -0500 Subject: [PATCH 5/9] Move all AO text into one file --- .../application_authorizing_official.html | 24 +-------- .../templates/includes/ao_example.html | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 23 deletions(-) create mode 100644 src/registrar/templates/includes/ao_example.html diff --git a/src/registrar/templates/application_authorizing_official.html b/src/registrar/templates/application_authorizing_official.html index f5c18b2ce..d83a59893 100644 --- a/src/registrar/templates/application_authorizing_official.html +++ b/src/registrar/templates/application_authorizing_official.html @@ -13,29 +13,7 @@

- {% if is_federal %} - {% if federal_type == 'executive' %} - {% include "includes/ao_example__exec.html" %} - {% elif federal_type == 'judicial' %} - {% include "includes/ao_example__judicial.html" %} - {% elif federal_type == 'legislative' %} - {% include "includes/ao_example__legislative.html" %} - {% endif %} - {% elif organization_type == 'city' %} - {% include "includes/ao_example__city.html" %} - {% elif organization_type == 'county' %} - {% include "includes/ao_example__county.html" %} - {% elif organization_type == 'interstate' %} - {% include "includes/ao_example__interstate.html" %} - {% elif organization_type == 'school_district' %} - {% include "includes/ao_example__school-district.html" %} - {% elif organization_type == 'special_district' %} - {% include "includes/ao_example__special-district.html" %} - {% elif organization_type == 'state_or_territory' %} - {% include "includes/ao_example__state-territory.html" %} - {% elif organization_type == 'tribal' %} - {% include "includes/ao_example__tribal.html" %} - {% endif %} + {% include "includes/ao_example.html" %}

We’ll contact your authorizing official to let them know that you made this request and to double check that they approve it.

diff --git a/src/registrar/templates/includes/ao_example.html b/src/registrar/templates/includes/ao_example.html new file mode 100644 index 000000000..f51752a38 --- /dev/null +++ b/src/registrar/templates/includes/ao_example.html @@ -0,0 +1,49 @@ +{% if is_federal %} + {% if federal_type == 'executive' %} +

Domain requests from executive branch agencies must be authorized by Chief Information Officers or agency heads.

+

Domain requests from executive branch agencies are subject to guidance issued by the U.S. Office of Management and Budget.

+ + {% elif federal_type == 'judicial' %} +

Domain requests from the U.S. Supreme Court must be authorized by the director of information technology for the U.S. Supreme Court.

+

Domain requests from other judicial branch agencies must be authorized by the director or Chief Information Officer of the Administrative Office (AO) of the United States Courts. +

+ + {% elif federal_type == 'legislative' %} +

U.S. Senate

+

Domain requests from the U.S. Senate must come from the Senate Sergeant at Arms.

+ +

U.S. House of Representatives

+

Domain requests from the U.S. House of Representatives must come from the House Chief Administrative Officer. + +

Other legislative branch agencies

+

Domain requests from legislative branch agencies must come from the agency’s head or Chief Information Officer.

+

Domain requests from legislative commissions must come from the head of the commission, or the head or Chief Information Officer of the parent agency, if there is one. +

+ + {% endif %} + +{% elif organization_type == 'city' %} +

Domain requests from cities must be authorized by the mayor or the equivalent highest elected official.

+ +{% elif organization_type == 'county' %} +

Domain requests from counties must be authorized by the chair of the county commission or the equivalent highest elected official.

+ +{% elif organization_type == 'interstate' %} +

Domain requests from interstate organizations must be authorized by the highest-ranking executive (president, director, chair, or equivalent) or one of the state’s governors or Chief Information Officers.

+ +{% elif organization_type == 'school_district' %} +

Domain requests from school district governments must be authorized by the highest-ranking executive (the chair of a school district’s board or a superintendent).

+ +{% elif organization_type == 'special_district' %} +

Domain requests from special districts must be authorized by the highest-ranking executive (president, director, chair, or equivalent) or state Chief Information Officers for state-based organizations.

+ +{% elif organization_type == 'state_or_territory' %} +

States and territories: executive branch

+

Domain requests from states and territories must be authorized by the governor or the state Chief Information Officer.

+

States and territories: judicial and legislative branches

+

Domain requests from state legislatures and courts must be authorized by an agency’s Chief Information Officer or highest-ranking executive.

+ +{% elif organization_type == 'tribal' %} +

Domain requests from federally-recognized tribal governments must be authorized by tribal chiefs as noted by the Bureau of Indian Affairs.

+ +{% endif %} From c0a0ae41e06a243a4b91a708f3415d239f11010e Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Mon, 23 Jan 2023 17:50:06 -0500 Subject: [PATCH 6/9] Remove indivdiual example files for ao --- src/registrar/templates/includes/ao_example__city.html | 1 - .../templates/includes/ao_example__county.html | 2 -- src/registrar/templates/includes/ao_example__exec.html | 3 --- .../templates/includes/ao_example__interstate.html | 2 -- .../templates/includes/ao_example__judicial.html | 4 ---- .../templates/includes/ao_example__legislative.html | 10 ---------- .../includes/ao_example__school-district.html | 3 --- .../includes/ao_example__special-district.html | 2 -- .../includes/ao_example__state-territory.html | 4 ---- .../templates/includes/ao_example__tribal.html | 2 -- 10 files changed, 33 deletions(-) delete mode 100644 src/registrar/templates/includes/ao_example__city.html delete mode 100644 src/registrar/templates/includes/ao_example__county.html delete mode 100644 src/registrar/templates/includes/ao_example__exec.html delete mode 100644 src/registrar/templates/includes/ao_example__interstate.html delete mode 100644 src/registrar/templates/includes/ao_example__judicial.html delete mode 100644 src/registrar/templates/includes/ao_example__legislative.html delete mode 100644 src/registrar/templates/includes/ao_example__school-district.html delete mode 100644 src/registrar/templates/includes/ao_example__special-district.html delete mode 100644 src/registrar/templates/includes/ao_example__state-territory.html delete mode 100644 src/registrar/templates/includes/ao_example__tribal.html diff --git a/src/registrar/templates/includes/ao_example__city.html b/src/registrar/templates/includes/ao_example__city.html deleted file mode 100644 index 6da683e23..000000000 --- a/src/registrar/templates/includes/ao_example__city.html +++ /dev/null @@ -1 +0,0 @@ -

Domain requests from cities must be authorized by the mayor or the equivalent highest elected official.

diff --git a/src/registrar/templates/includes/ao_example__county.html b/src/registrar/templates/includes/ao_example__county.html deleted file mode 100644 index 8f37a3419..000000000 --- a/src/registrar/templates/includes/ao_example__county.html +++ /dev/null @@ -1,2 +0,0 @@ -

Domain requests from counties must be authorized by the chair of the county commission or the equivalent highest elected official.

- diff --git a/src/registrar/templates/includes/ao_example__exec.html b/src/registrar/templates/includes/ao_example__exec.html deleted file mode 100644 index 8be0843c8..000000000 --- a/src/registrar/templates/includes/ao_example__exec.html +++ /dev/null @@ -1,3 +0,0 @@ -

Domain requests from executive branch agencies must be authorized by Chief Information Officers or agency heads.

-

Domain requests from executive branch agencies are subject to guidance issued by the U.S. Office of Management and Budget.

- diff --git a/src/registrar/templates/includes/ao_example__interstate.html b/src/registrar/templates/includes/ao_example__interstate.html deleted file mode 100644 index f3c05e62a..000000000 --- a/src/registrar/templates/includes/ao_example__interstate.html +++ /dev/null @@ -1,2 +0,0 @@ -

Domain requests from interstate organizations must be authorized by the highest-ranking executive (president, director, chair, or equivalent) or one of the state’s governors or Chief Information Officers.

- diff --git a/src/registrar/templates/includes/ao_example__judicial.html b/src/registrar/templates/includes/ao_example__judicial.html deleted file mode 100644 index 773f13cb6..000000000 --- a/src/registrar/templates/includes/ao_example__judicial.html +++ /dev/null @@ -1,4 +0,0 @@ -

Domain requests from the U.S. Supreme Court must be authorized by the director of information technology for the U.S. Supreme Court.

-

Domain requests from other judicial branch agencies must be authorized by the director or Chief Information Officer of the Administrative Office (AO) of the United States Courts. -

- diff --git a/src/registrar/templates/includes/ao_example__legislative.html b/src/registrar/templates/includes/ao_example__legislative.html deleted file mode 100644 index f0398c101..000000000 --- a/src/registrar/templates/includes/ao_example__legislative.html +++ /dev/null @@ -1,10 +0,0 @@ -

U.S. Senate

-

Domain requests from the U.S. Senate must come from the Senate Sergeant at Arms.

- -

U.S. House of Representatives

-

Domain requests from the U.S. House of Representatives must come from the House Chief Administrative Officer. - -

Other legislative branch agencies

-

Domain requests from legislative branch agencies must come from the agency’s head or Chief Information Officer.

-

Domain requests from legislative commissions must come from the head of the commission, or the head or Chief Information Officer of the parent agency, if there is one. -

diff --git a/src/registrar/templates/includes/ao_example__school-district.html b/src/registrar/templates/includes/ao_example__school-district.html deleted file mode 100644 index 142e433af..000000000 --- a/src/registrar/templates/includes/ao_example__school-district.html +++ /dev/null @@ -1,3 +0,0 @@ -

Domain requests from school district governments must be authorized by the highest-ranking executive (the chair of a school district’s board or a superintendent). -

- diff --git a/src/registrar/templates/includes/ao_example__special-district.html b/src/registrar/templates/includes/ao_example__special-district.html deleted file mode 100644 index eb4b48d9c..000000000 --- a/src/registrar/templates/includes/ao_example__special-district.html +++ /dev/null @@ -1,2 +0,0 @@ -

Domain requests from special districts must be authorized by the highest-ranking executive (president, director, chair, or equivalent) or state Chief Information Officers for state-based organizations.

- diff --git a/src/registrar/templates/includes/ao_example__state-territory.html b/src/registrar/templates/includes/ao_example__state-territory.html deleted file mode 100644 index f08a59f5f..000000000 --- a/src/registrar/templates/includes/ao_example__state-territory.html +++ /dev/null @@ -1,4 +0,0 @@ -

States and territories: executive branch

-

Domain requests from states and territories must be authorized by the governor or the state Chief Information Officer.

-

States and territories: judicial and legislative branches

-

Domain requests from state legislatures and courts must be authorized by an agency’s Chief Information Officer or highest-ranking executive.

diff --git a/src/registrar/templates/includes/ao_example__tribal.html b/src/registrar/templates/includes/ao_example__tribal.html deleted file mode 100644 index 8184d4822..000000000 --- a/src/registrar/templates/includes/ao_example__tribal.html +++ /dev/null @@ -1,2 +0,0 @@ -

Domain requests from federally-recognized tribal governments must be authorized by tribal chiefs as noted by the Bureau of Indian Affairs.

- From 04e7eba98308df8afa081584a64843fffe55d63a Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Mon, 23 Jan 2023 17:52:45 -0500 Subject: [PATCH 7/9] Fix linter issue --- src/registrar/tests/test_views.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index 32973d0cf..fb71b3ab0 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -881,7 +881,6 @@ class DomainApplicationTests(TestWithUser, WebTest): # ---- DOTGOV DOMAIN PAGE ---- self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) dotgov_page = current_sites_result.follow() - dotgov_form = dotgov_page.form self.assertContains(dotgov_page, "medicare.gov") @@ -900,7 +899,6 @@ class DomainApplicationTests(TestWithUser, WebTest): self.assertContains(dotgov_page, "BlufftonIndiana.gov") self.assertNotContains(dotgov_page, "medicare.gov") - @skip("WIP") def test_application_edit_restore(self): """ From 0337bbc5362667a883a2b5e6a14d1a7e23933465 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Tue, 24 Jan 2023 12:35:16 -0500 Subject: [PATCH 8/9] Update AO example for tribal orgs to match latest --- src/registrar/templates/includes/ao_example.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registrar/templates/includes/ao_example.html b/src/registrar/templates/includes/ao_example.html index f51752a38..4d6b5a301 100644 --- a/src/registrar/templates/includes/ao_example.html +++ b/src/registrar/templates/includes/ao_example.html @@ -44,6 +44,6 @@

Domain requests from state legislatures and courts must be authorized by an agency’s Chief Information Officer or highest-ranking executive.

{% elif organization_type == 'tribal' %} -

Domain requests from federally-recognized tribal governments must be authorized by tribal chiefs as noted by the Bureau of Indian Affairs.

+

Domain requests from federally-recognized tribal governments must be authorized by the leader of the tribe, as recognized by the as noted by the Bureau of Indian Affairs.

{% endif %} From 7b5824243393cc707a9f6f747126f8caf71b8b40 Mon Sep 17 00:00:00 2001 From: igorkorenfeld Date: Wed, 25 Jan 2023 12:44:31 -0500 Subject: [PATCH 9/9] Fix failing tests after merge --- src/registrar/tests/test_views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/registrar/tests/test_views.py b/src/registrar/tests/test_views.py index 5fe99c8a5..cbcaa9aec 100644 --- a/src/registrar/tests/test_views.py +++ b/src/registrar/tests/test_views.py @@ -872,7 +872,7 @@ class DomainApplicationTests(TestWithUser, WebTest): self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) current_sites_page = ao_result.follow() current_sites_form = current_sites_page.form - current_sites_form["current_sites-current_site"] = "www.city.com" + current_sites_form["current_sites-0-website"] = "www.city.com" # test saving the page self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id) @@ -902,6 +902,7 @@ class DomainApplicationTests(TestWithUser, WebTest): def test_application_formsets(self): """Users are able to add more than one of some fields.""" current_sites_page = self.app.get(reverse("application:current_sites")) + session_id = self.app.cookies[settings.SESSION_COOKIE_NAME] # fill in the form field current_sites_form = current_sites_page.form self.assertIn("current_sites-0-website", current_sites_form.fields)