mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-14 16:47:02 +02:00
Changes but with comments this time
This commit is contained in:
parent
28a80ace36
commit
a4adb5ed46
14 changed files with 56 additions and 9 deletions
|
@ -233,6 +233,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
||||||
search_help_text = "Search by domain or submitter."
|
search_help_text = "Search by domain or submitter."
|
||||||
|
|
||||||
# Detail view
|
# Detail view
|
||||||
|
# TODO-446: Add "about_your_organization" + remove "type_of_work" and "more_organization_information"
|
||||||
fieldsets = [
|
fieldsets = [
|
||||||
(None, {"fields": ["status", "investigator", "creator"]}),
|
(None, {"fields": ["status", "investigator", "creator"]}),
|
||||||
(
|
(
|
||||||
|
@ -283,6 +284,7 @@ class DomainApplicationAdmin(ListHeaderAdmin):
|
||||||
]
|
]
|
||||||
|
|
||||||
# Read only that we'll leverage for CISA Analysts
|
# Read only that we'll leverage for CISA Analysts
|
||||||
|
# TODO-446: Add "about_your_organization" + remove "type_of_work" and "more_organization_information"
|
||||||
analyst_readonly_fields = [
|
analyst_readonly_fields = [
|
||||||
"creator",
|
"creator",
|
||||||
"type_of_work",
|
"type_of_work",
|
||||||
|
|
|
@ -19,6 +19,7 @@ application_urls = [
|
||||||
path("finished/", views.Finished.as_view(), name="finished"),
|
path("finished/", views.Finished.as_view(), name="finished"),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# TODO-446: (Step.ABOUT_YOUR_ORGANIZATION, views.AboutYourOrganization),
|
||||||
# dynamically generate the other application_urls
|
# dynamically generate the other application_urls
|
||||||
for step, view in [
|
for step, view in [
|
||||||
# add/remove steps here
|
# add/remove steps here
|
||||||
|
|
|
@ -309,12 +309,8 @@ class OrganizationContactForm(RegistrarForm):
|
||||||
)
|
)
|
||||||
return federal_agency
|
return federal_agency
|
||||||
|
|
||||||
|
# TODO-446: Update name of form + variable naming
|
||||||
class TypeOfWorkForm(RegistrarForm):
|
class TypeOfWorkForm(RegistrarForm):
|
||||||
# TO DO:
|
|
||||||
# 1. Confirm it's required
|
|
||||||
# 2. Even if it is required, the label seems to be reading from somewhere and not hiding itself
|
|
||||||
# 3. Fix all emails to be - about your organization but we need to fix title somehow
|
|
||||||
type_of_work = forms.CharField(
|
type_of_work = forms.CharField(
|
||||||
required=False,
|
required=False,
|
||||||
label="TypeOfWork",
|
label="TypeOfWork",
|
||||||
|
@ -325,7 +321,7 @@ class TypeOfWorkForm(RegistrarForm):
|
||||||
message="Response must be less than 1000 characters.",
|
message="Response must be less than 1000 characters.",
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
# Confirm if this error message wording is ok, prev was "Enter the type of work your organization does."
|
# TODO-446: Confirm if this error message wording is ok, prev was "Enter the type of work your organization does."
|
||||||
error_messages={
|
error_messages={
|
||||||
"required": ("Enter information about your organization.")
|
"required": ("Enter information about your organization.")
|
||||||
},
|
},
|
||||||
|
|
|
@ -384,12 +384,21 @@ class DomainApplication(TimeStampedModel):
|
||||||
help_text="Type of work of the organization",
|
help_text="Type of work of the organization",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO-446:
|
||||||
|
# about_your_organization = models.TextField(
|
||||||
|
# null=True,
|
||||||
|
# blank=True,
|
||||||
|
# help_text="Information about your organization",
|
||||||
|
# )
|
||||||
|
|
||||||
more_organization_information = models.TextField(
|
more_organization_information = models.TextField(
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="More information about your organization",
|
help_text="More information about your organization",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO-446: Remove above bc we don't need this textbox anymore
|
||||||
|
|
||||||
authorizing_official = models.ForeignKey(
|
authorizing_official = models.ForeignKey(
|
||||||
"registrar.Contact",
|
"registrar.Contact",
|
||||||
null=True,
|
null=True,
|
||||||
|
@ -653,6 +662,7 @@ class DomainApplication(TimeStampedModel):
|
||||||
]
|
]
|
||||||
return bool(user_choice and user_choice not in excluded)
|
return bool(user_choice and user_choice not in excluded)
|
||||||
|
|
||||||
|
# TODO-446: Rename to show_about_your_organization
|
||||||
def show_type_of_work(self) -> bool:
|
def show_type_of_work(self) -> bool:
|
||||||
"""Show this step if this is a special district or interstate."""
|
"""Show this step if this is a special district or interstate."""
|
||||||
user_choice = self.organization_type
|
user_choice = self.organization_type
|
||||||
|
|
|
@ -140,12 +140,21 @@ class DomainInformation(TimeStampedModel):
|
||||||
help_text="Type of work of the organization",
|
help_text="Type of work of the organization",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO-446:
|
||||||
|
# about_your_organization = models.TextField(
|
||||||
|
# null=True,
|
||||||
|
# blank=True,
|
||||||
|
# help_text="Information about your organization",
|
||||||
|
# )
|
||||||
|
|
||||||
more_organization_information = models.TextField(
|
more_organization_information = models.TextField(
|
||||||
null=True,
|
null=True,
|
||||||
blank=True,
|
blank=True,
|
||||||
help_text="Further information about the government organization",
|
help_text="Further information about the government organization",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO-446: Remove above bc we don't need this textbox anymore
|
||||||
|
|
||||||
authorizing_official = models.ForeignKey(
|
authorizing_official = models.ForeignKey(
|
||||||
"registrar.Contact",
|
"registrar.Contact",
|
||||||
null=True,
|
null=True,
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
Incomplete
|
Incomplete
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<!-- TODO-446: {% if step == Step.ABOUT_YOUR_ORGANIZATION %} -->
|
||||||
{% if step == Step.TYPE_OF_WORK %}
|
{% if step == Step.TYPE_OF_WORK %}
|
||||||
<p>{{ application.type_of_work|default:"Incomplete" }}</p>
|
<p>{{ application.type_of_work|default:"Incomplete" }}</p>
|
||||||
<p>{{ application.more_organization_information|default:"Incomplete" }}</p>
|
<p>{{ application.more_organization_information|default:"Incomplete" }}</p>
|
||||||
|
|
|
@ -68,6 +68,11 @@
|
||||||
{% include "includes/summary_item.html" with title='Organization name and mailing address' value=domainapplication address='true' heading_level=heading_level %}
|
{% include "includes/summary_item.html" with title='Organization name and mailing address' value=domainapplication address='true' heading_level=heading_level %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- TODO-446:
|
||||||
|
{% if domainapplication.about_your_organization %}
|
||||||
|
{% include "includes/summary_item.html" with title='About your organization' value=domainapplication.about_your_organization heading_level=heading_level %}
|
||||||
|
{% endif %} -->
|
||||||
|
|
||||||
{% if domainapplication.type_of_work %}
|
{% if domainapplication.type_of_work %}
|
||||||
{% include "includes/summary_item.html" with title='Type of work' value=domainapplication.type_of_work heading_level=heading_level %}
|
{% include "includes/summary_item.html" with title='Type of work' value=domainapplication.type_of_work heading_level=heading_level %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -76,6 +81,8 @@
|
||||||
{% include "includes/summary_item.html" with title='More information about your organization' value=domainapplication.more_organization_information heading_level=heading_level %}
|
{% include "includes/summary_item.html" with title='More information about your organization' value=domainapplication.more_organization_information heading_level=heading_level %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
<!-- TODO-446: Remove above because won't need the textbox anymore -->
|
||||||
|
|
||||||
{% if domainapplication.authorizing_official %}
|
{% if domainapplication.authorizing_official %}
|
||||||
{% include "includes/summary_item.html" with title='Authorizing official' value=domainapplication.authorizing_official contact='true' heading_level=heading_level %}
|
{% include "includes/summary_item.html" with title='Authorizing official' value=domainapplication.authorizing_official contact='true' heading_level=heading_level %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{% extends 'application_form.html' %}
|
{% extends 'application_form.html' %}
|
||||||
{% load field_helpers %}
|
{% load field_helpers %}
|
||||||
|
|
||||||
|
<!-- TODO-446: Change name of file to be application_about_your_organization.html -->
|
||||||
|
|
||||||
{% block form_instructions %}
|
{% block form_instructions %}
|
||||||
<p>[For special districts, interstate governments]</p>
|
<p>[For special districts, interstate governments]</p>
|
||||||
|
@ -19,6 +20,7 @@
|
||||||
{# empty this block so it doesn't show on this page #}
|
{# empty this block so it doesn't show on this page #}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
<!-- TODO-446: Change name form name -->
|
||||||
{% block form_fields %}
|
{% block form_fields %}
|
||||||
{% with attr_maxlength=1000 %}
|
{% with attr_maxlength=1000 %}
|
||||||
{% input_with_errors forms.0.type_of_work %}
|
{% input_with_errors forms.0.type_of_work %}
|
||||||
|
|
|
@ -248,6 +248,7 @@ class AuditedAdminMockData:
|
||||||
creator: User = self.dummy_user(item_name, "creator"),
|
creator: User = self.dummy_user(item_name, "creator"),
|
||||||
}
|
}
|
||||||
""" # noqa
|
""" # noqa
|
||||||
|
# TODO-446: Update type_of_work to about_your_organization
|
||||||
common_args = dict(
|
common_args = dict(
|
||||||
organization_type=org_type,
|
organization_type=org_type,
|
||||||
federal_type=federal_type,
|
federal_type=federal_type,
|
||||||
|
@ -433,7 +434,7 @@ def create_user():
|
||||||
password=p,
|
password=p,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO-446: Update has_type_of_work to has_about_your_organization
|
||||||
def completed_application(
|
def completed_application(
|
||||||
has_other_contacts=True,
|
has_other_contacts=True,
|
||||||
has_current_website=True,
|
has_current_website=True,
|
||||||
|
@ -486,6 +487,7 @@ def completed_application(
|
||||||
creator=user,
|
creator=user,
|
||||||
status=status,
|
status=status,
|
||||||
)
|
)
|
||||||
|
# TODO-446: Update has_type_of_work to has_about_your_organization
|
||||||
if has_type_of_work:
|
if has_type_of_work:
|
||||||
domain_application_kwargs["type_of_work"] = "e-Government"
|
domain_application_kwargs["type_of_work"] = "e-Government"
|
||||||
if has_anything_else:
|
if has_anything_else:
|
||||||
|
|
|
@ -316,6 +316,7 @@ class TestDomainApplicationAdmin(TestCase):
|
||||||
|
|
||||||
readonly_fields = self.admin.get_readonly_fields(request, application)
|
readonly_fields = self.admin.get_readonly_fields(request, application)
|
||||||
|
|
||||||
|
# TODO-446: Add about_your_organization + remove type_of_work and more_organization_information
|
||||||
expected_fields = [
|
expected_fields = [
|
||||||
"id",
|
"id",
|
||||||
"created_at",
|
"created_at",
|
||||||
|
@ -360,6 +361,7 @@ class TestDomainApplicationAdmin(TestCase):
|
||||||
|
|
||||||
readonly_fields = self.admin.get_readonly_fields(request)
|
readonly_fields = self.admin.get_readonly_fields(request)
|
||||||
|
|
||||||
|
# TODO-446: Add about_your_organization + remove type_of_work and more_organization_information
|
||||||
expected_fields = [
|
expected_fields = [
|
||||||
"creator",
|
"creator",
|
||||||
"type_of_work",
|
"type_of_work",
|
||||||
|
|
|
@ -125,6 +125,7 @@ class TestEmails(TestCase):
|
||||||
# spacing should be right between adjacent elements
|
# spacing should be right between adjacent elements
|
||||||
self.assertRegex(body, r"city.gov\n\nPurpose of your domain:")
|
self.assertRegex(body, r"city.gov\n\nPurpose of your domain:")
|
||||||
|
|
||||||
|
# TODO-446: Update type_of_work -> about_your_organization
|
||||||
@boto3_mocking.patching
|
@boto3_mocking.patching
|
||||||
def test_submission_confirmation_type_of_work_spacing(self):
|
def test_submission_confirmation_type_of_work_spacing(self):
|
||||||
"""Test line spacing with type of work."""
|
"""Test line spacing with type of work."""
|
||||||
|
@ -137,6 +138,7 @@ class TestEmails(TestCase):
|
||||||
# spacing should be right between adjacent elements
|
# spacing should be right between adjacent elements
|
||||||
self.assertRegex(body, r"10002\n\nType of work:")
|
self.assertRegex(body, r"10002\n\nType of work:")
|
||||||
|
|
||||||
|
# TODO-446: Update type_of_work -> about_your_organization
|
||||||
@boto3_mocking.patching
|
@boto3_mocking.patching
|
||||||
def test_submission_confirmation_no_type_of_work_spacing(self):
|
def test_submission_confirmation_no_type_of_work_spacing(self):
|
||||||
"""Test line spacing without type of work."""
|
"""Test line spacing without type of work."""
|
||||||
|
|
|
@ -118,6 +118,7 @@ class TestFormValidation(TestCase):
|
||||||
["Response must be less than 1000 characters."],
|
["Response must be less than 1000 characters."],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO-446: Update type_of_work -> about_your_organization
|
||||||
def test_anything_else_form_type_of_work_character_count_invalid(self):
|
def test_anything_else_form_type_of_work_character_count_invalid(self):
|
||||||
"""Response must be less than 1000 characters."""
|
"""Response must be less than 1000 characters."""
|
||||||
form = AnythingElseForm(
|
form = AnythingElseForm(
|
||||||
|
@ -147,6 +148,7 @@ class TestFormValidation(TestCase):
|
||||||
["Response must be less than 1000 characters."],
|
["Response must be less than 1000 characters."],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO-446: Can remove bc don't have this textbox anymore
|
||||||
def test_anything_else_form_more_organization_information_character_count_invalid(
|
def test_anything_else_form_more_organization_information_character_count_invalid(
|
||||||
self,
|
self,
|
||||||
):
|
):
|
||||||
|
@ -179,6 +181,7 @@ class TestFormValidation(TestCase):
|
||||||
["Response must be less than 1000 characters."],
|
["Response must be less than 1000 characters."],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO-446: Update type_of_work -> about_your_organization in data and assertEqual
|
||||||
def test_anything_else_form_character_count_invalid(self):
|
def test_anything_else_form_character_count_invalid(self):
|
||||||
"""Response must be less than 1000 characters."""
|
"""Response must be less than 1000 characters."""
|
||||||
form = TypeOfWorkForm(
|
form = TypeOfWorkForm(
|
||||||
|
|
|
@ -664,7 +664,9 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
||||||
# if it was successful.
|
# if it was successful.
|
||||||
self.assertEqual(contact_result.status_code, 302)
|
self.assertEqual(contact_result.status_code, 302)
|
||||||
self.assertEqual(contact_result["Location"], "/register/type_of_work/")
|
self.assertEqual(contact_result["Location"], "/register/type_of_work/")
|
||||||
|
# TODO-446: self.assertEqual(contact_result["Location"], "/register/about_your_organization/")
|
||||||
|
|
||||||
|
# TODO-446: Update type_of_work -> about_your_organization
|
||||||
def test_application_type_of_work_special(self):
|
def test_application_type_of_work_special(self):
|
||||||
"""Special districts have to answer an additional question."""
|
"""Special districts have to answer an additional question."""
|
||||||
type_page = self.app.get(reverse("application:")).follow()
|
type_page = self.app.get(reverse("application:")).follow()
|
||||||
|
@ -685,6 +687,8 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
||||||
contact_page = type_result.follow()
|
contact_page = type_result.follow()
|
||||||
|
|
||||||
self.assertContains(contact_page, self.TITLES[Step.TYPE_OF_WORK])
|
self.assertContains(contact_page, self.TITLES[Step.TYPE_OF_WORK])
|
||||||
|
# TODO-446: self.assertContains(contact_page, self.TITLES[Step.ABOUT_YOUR_ORGANIZATION])
|
||||||
|
|
||||||
|
|
||||||
def test_application_no_other_contacts(self):
|
def test_application_no_other_contacts(self):
|
||||||
"""Applicants with no other contacts have to give a reason."""
|
"""Applicants with no other contacts have to give a reason."""
|
||||||
|
@ -704,6 +708,7 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
||||||
actual_url_slug = no_contacts_page.request.path.split("/")[-2]
|
actual_url_slug = no_contacts_page.request.path.split("/")[-2]
|
||||||
self.assertEqual(expected_url_slug, actual_url_slug)
|
self.assertEqual(expected_url_slug, actual_url_slug)
|
||||||
|
|
||||||
|
# TODO-446: Update type_of_work -> about_your_organization
|
||||||
def test_application_type_of_work_interstate(self):
|
def test_application_type_of_work_interstate(self):
|
||||||
"""Special districts have to answer an additional question."""
|
"""Special districts have to answer an additional question."""
|
||||||
type_page = self.app.get(reverse("application:")).follow()
|
type_page = self.app.get(reverse("application:")).follow()
|
||||||
|
@ -724,6 +729,8 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
||||||
contact_page = type_result.follow()
|
contact_page = type_result.follow()
|
||||||
|
|
||||||
self.assertContains(contact_page, self.TITLES[Step.TYPE_OF_WORK])
|
self.assertContains(contact_page, self.TITLES[Step.TYPE_OF_WORK])
|
||||||
|
# TODO-446: self.assertContains(contact_page, self.TITLES[Step.ABOUT_YOUR_ORGANIZATION])
|
||||||
|
|
||||||
|
|
||||||
def test_application_tribal_government(self):
|
def test_application_tribal_government(self):
|
||||||
"""Tribal organizations have to answer an additional question."""
|
"""Tribal organizations have to answer an additional question."""
|
||||||
|
|
|
@ -17,6 +17,7 @@ from .utility import DomainApplicationPermissionView, ApplicationWizardPermissio
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
# TODO-446: ABOUT_YOUR_ORGANIZATION = "about_your_organization"
|
||||||
class Step(StrEnum):
|
class Step(StrEnum):
|
||||||
"""
|
"""
|
||||||
Names for each page of the application wizard.
|
Names for each page of the application wizard.
|
||||||
|
@ -71,6 +72,7 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
|
||||||
EDIT_URL_NAME = "edit-application"
|
EDIT_URL_NAME = "edit-application"
|
||||||
NEW_URL_NAME = "/register/"
|
NEW_URL_NAME = "/register/"
|
||||||
# We need to pass our human-readable step titles as context to the templates.
|
# We need to pass our human-readable step titles as context to the templates.
|
||||||
|
# TODO-446: Step.ABOUT_YOUR_ORGANIZATION: _("About your organization"),
|
||||||
TITLES = {
|
TITLES = {
|
||||||
Step.ORGANIZATION_TYPE: _("Type of organization"),
|
Step.ORGANIZATION_TYPE: _("Type of organization"),
|
||||||
Step.TRIBAL_GOVERNMENT: _("Tribal government"),
|
Step.TRIBAL_GOVERNMENT: _("Tribal government"),
|
||||||
|
@ -92,6 +94,7 @@ class ApplicationWizard(ApplicationWizardPermissionView, TemplateView):
|
||||||
|
|
||||||
# We can use a dictionary with step names and callables that return booleans
|
# We can use a dictionary with step names and callables that return booleans
|
||||||
# to show or hide particular steps based on the state of the process.
|
# to show or hide particular steps based on the state of the process.
|
||||||
|
# TODO-446: Step.ABOUT_YOUR_ORGANIZATION: lambda w: w.from_model("show_about_your_organization", False),
|
||||||
WIZARD_CONDITIONS = {
|
WIZARD_CONDITIONS = {
|
||||||
Step.ORGANIZATION_FEDERAL: lambda w: w.from_model(
|
Step.ORGANIZATION_FEDERAL: lambda w: w.from_model(
|
||||||
"show_organization_federal", False
|
"show_organization_federal", False
|
||||||
|
@ -372,7 +375,7 @@ class OrganizationContact(ApplicationWizard):
|
||||||
template_name = "application_org_contact.html"
|
template_name = "application_org_contact.html"
|
||||||
forms = [forms.OrganizationContactForm]
|
forms = [forms.OrganizationContactForm]
|
||||||
|
|
||||||
|
# TODO-446: Probs step 1 after migration? Update typeofwork naming to about_your_organization
|
||||||
class TypeOfWork(ApplicationWizard):
|
class TypeOfWork(ApplicationWizard):
|
||||||
template_name = "application_type_of_work.html"
|
template_name = "application_type_of_work.html"
|
||||||
forms = [forms.TypeOfWorkForm]
|
forms = [forms.TypeOfWorkForm]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue