mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 12:38:36 +02:00
Review feedback too numerous to mention
This commit is contained in:
parent
56606f32e0
commit
f7e0975e4c
17 changed files with 196 additions and 57 deletions
|
@ -6,6 +6,7 @@ from registrar.forms.application_wizard import (
|
|||
CurrentSitesForm,
|
||||
DotGovDomainForm,
|
||||
AuthorizingOfficialForm,
|
||||
OrganizationContactForm,
|
||||
YourContactForm,
|
||||
OtherContactsForm,
|
||||
SecurityEmailForm,
|
||||
|
@ -14,6 +15,17 @@ from registrar.forms.application_wizard import (
|
|||
|
||||
|
||||
class TestFormValidation(TestCase):
|
||||
def test_org_contact_zip_invalid(self):
|
||||
form = OrganizationContactForm (data={"zipcode": "nah"})
|
||||
self.assertEqual(
|
||||
form.errors["zipcode"], ["Please enter a ZIP code in the form 12345 or 12345-6789"]
|
||||
)
|
||||
|
||||
def test_org_contact_zip_valid(self):
|
||||
for zipcode in ["12345", "12345-6789"]:
|
||||
form = OrganizationContactForm (data={"zipcode": zipcode})
|
||||
self.assertNotIn("zipcode", form.errors)
|
||||
|
||||
def test_current_site_invalid(self):
|
||||
form = CurrentSitesForm(data={"current_site": "nah"})
|
||||
self.assertEqual(
|
||||
|
@ -24,6 +36,12 @@ class TestFormValidation(TestCase):
|
|||
form = CurrentSitesForm(data={"current_site": "hyphens-rule.gov.uk"})
|
||||
self.assertEqual(len(form.errors), 0)
|
||||
|
||||
def test_current_site_scheme_valid(self):
|
||||
form = CurrentSitesForm(data={"current_site": "http://hyphens-rule.gov.uk"})
|
||||
self.assertEqual(len(form.errors), 0)
|
||||
form = CurrentSitesForm(data={"current_site": "https://hyphens-rule.gov.uk"})
|
||||
self.assertEqual(len(form.errors), 0)
|
||||
|
||||
def test_requested_domain_valid(self):
|
||||
"""Just a valid domain name with no .gov at the end."""
|
||||
form = DotGovDomainForm(data={"requested_domain": "top-level-agency"})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue