removing security from test cases. still need to clean up

This commit is contained in:
Jon Roberts 2023-02-27 10:30:44 -07:00
parent 1441044415
commit b12e97f674
No known key found for this signature in database
GPG key ID: EED093582198B041
7 changed files with 2 additions and 65 deletions

View file

@ -14,7 +14,6 @@
"http://app:8080/register/purpose/",
"http://app:8080/register/your_contact/",
"http://app:8080/register/other_contacts/",
"http://app:8080/register/security_email/",
"http://app:8080/register/anything_else/",
"http://app:8080/register/requirements/",
"http://app:8080/register/review/",

View file

@ -89,7 +89,6 @@ class DomainApplicationFixture:
# "zipcode": None,
# "urbanization": None,
# "purpose": None,
# "security_email": None,
# "anything_else": None,
# "is_policy_acknowledged": None,
# "authorizing_official": None,
@ -152,7 +151,6 @@ class DomainApplicationFixture:
da.zipcode = app["zipcode"] if "zipcode" in app else fake.postalcode()
da.urbanization = app["urbanization"] if "urbanization" in app else None
da.purpose = app["purpose"] if "purpose" in app else fake.paragraph()
da.security_email = app["security_email"] if "security_email" in app else None
da.anything_else = app["anything_else"] if "anything_else" in app else None
da.is_policy_acknowledged = (
app["is_policy_acknowledged"] if "is_policy_acknowledged" in app else True

View file

@ -312,15 +312,6 @@ class Migration(migrations.Migration):
blank=True, help_text="Purpose of the domain", null=True
),
),
(
"security_email",
models.CharField(
blank=True,
help_text="Security email for public use",
max_length=320,
null=True,
),
),
(
"anything_else",
models.TextField(

View file

@ -440,13 +440,6 @@ class DomainApplication(TimeStampedModel):
help_text="Reason for listing no additional contacts",
)
security_email = models.CharField(
max_length=320,
null=True,
blank=True,
help_text="Security email for public use",
)
anything_else = models.TextField(
null=True,
blank=True,

View file

@ -75,9 +75,6 @@
None
{% endfor %}
{% endif %}
{% if step == Step.SECURITY_EMAIL %}
{{ application.security_email|default:"None" }}
{% endif %}
{% if step == Step.ANYTHING_ELSE %}
{{ application.anything_else|default:"No" }}
{% endif %}

View file

@ -1,14 +0,0 @@
{% extends 'application_form.html' %}
{% load field_helpers %}
{% block form_instructions %}
<p>We strongly recommend that you provide a security email. This email will allow the
public to report observed or suspected security issues on your domain.
<strong>Security emails are made public.</strong> We recommend using an alias, like
security@&lt;domain.gov&gt;.</p>
{% endblock %}
{% block form_fields %}
{% input_with_errors forms.0.security_email %}
{% endblock %}

View file

@ -402,39 +402,14 @@ class DomainApplicationTests(TestWithUser, WebTest):
self.assertEquals(other_contacts_result.status_code, 302)
self.assertEquals(
other_contacts_result["Location"], "/register/security_email/"
other_contacts_result["Location"], "/register/anything_else/"
)
num_pages_tested += 1
# ---- SECURITY EMAIL PAGE ----
# Follow the redirect to the next form page
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
security_email_page = other_contacts_result.follow()
security_email_form = security_email_page.form
security_email_form["security_email-security_email"] = "security@city.com"
# test saving the page
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
result = security_email_page.form.submit("submit_button", value="save")
# should remain on the same page
self.assertEquals(result["Location"], "/register/security_email/")
# should see results in db
application = DomainApplication.objects.get() # there's only one
self.assertEquals(application.security_email, "security@city.com")
# test next button
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
security_email_result = security_email_form.submit()
self.assertEquals(security_email_result.status_code, 302)
self.assertEquals(security_email_result["Location"], "/register/anything_else/")
num_pages_tested += 1
# ---- ANYTHING ELSE PAGE ----
# Follow the redirect to the next form page
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
anything_else_page = security_email_result.follow()
anything_else_page = other_contacts_result.follow()
anything_else_form = anything_else_page.form
anything_else_form["anything_else-anything_else"] = "Nothing else."
@ -516,7 +491,6 @@ class DomainApplicationTests(TestWithUser, WebTest):
self.assertContains(review_page, "Another Tester")
self.assertContains(review_page, "testy2@town.com")
self.assertContains(review_page, "(201) 555-5557")
self.assertContains(review_page, "security@city.com")
self.assertContains(review_page, "Nothing else.")
# test saving the page
@ -986,7 +960,6 @@ class DomainApplicationTests(TestWithUser, WebTest):
organization_type="federal",
federal_type="executive",
purpose="Purpose of the site",
security_email="security@city.com",
anything_else="No",
is_policy_acknowledged=True,
organization_name="Testorg",