From c8513bbfdcd8c8a9ef7e17811ae5f5aa8a49ffe9 Mon Sep 17 00:00:00 2001 From: David Kennedy Date: Mon, 22 Jan 2024 17:09:13 -0500 Subject: [PATCH] updated email output for application submission, and updated associated tests --- .../emails/includes/application_summary.txt | 19 +++++++++++++++++-- src/registrar/tests/test_emails.py | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/registrar/templates/emails/includes/application_summary.txt b/src/registrar/templates/emails/includes/application_summary.txt index 215564feb..2c3564ad7 100644 --- a/src/registrar/templates/emails/includes/application_summary.txt +++ b/src/registrar/templates/emails/includes/application_summary.txt @@ -2,7 +2,19 @@ SUMMARY OF YOUR DOMAIN REQUEST Type of organization: {{ application.get_organization_type_display }} - +{% if application.show_organization_federal %} +Federal government branch: +{{ application.get_federal_type_display }} +{% elif application.show_tribal_government %} +Tribal government: +{{ application.tribe_name|default:"Incomplete" }}{% if application.federally_recognized_tribe %} +Federally-recognized tribe +{% endif %}{% if application.state_recognized_tribe %} +State-recognized tribe +{% endif %}{% endif %}{% if application.show_organization_election %} +Election office: +{{ application.is_election_board|yesno:"Yes,No,Incomplete" }} +{% endif %} Organization name and mailing address: {% spaceless %}{{ application.organization_name }} {{ application.address_line1 }}{% if application.address_line2 %} @@ -35,7 +47,10 @@ Your contact information: Other employees from your organization: {% for other in application.other_contacts.all %} {% spaceless %}{% include "emails/includes/contact.txt" with contact=other %}{% endspaceless %} -{% endfor %}{% endif %}{% if application.anything_else %} +{% endfor %}{% else %} +No other employees from your organization? +{{ application.no_other_contacts_rationale }} +{% endif %}{% if application.anything_else %} Anything else? {{ application.anything_else }} {% endif %} \ No newline at end of file diff --git a/src/registrar/tests/test_emails.py b/src/registrar/tests/test_emails.py index ae84980ff..d21358402 100644 --- a/src/registrar/tests/test_emails.py +++ b/src/registrar/tests/test_emails.py @@ -104,7 +104,8 @@ class TestEmails(TestCase): body = kwargs["Content"]["Simple"]["Body"]["Text"]["Data"] self.assertNotIn("Other employees from your organization:", body) # spacing should be right between adjacent elements - self.assertRegex(body, r"5556\n\nAnything else") + self.assertRegex(body, r"5556\n\nNo other employees") + self.assertRegex(body, r"None\n\nAnything else") @boto3_mocking.patching def test_submission_confirmation_alternative_govdomain_spacing(self):