mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-03 00:12:16 +02:00
Merge pull request #1908 from cisagov/za/1651-increase-character-limit
Ticket #1651: Increase character limit of text fields
This commit is contained in:
commit
03aa034da3
5 changed files with 68 additions and 15 deletions
|
@ -319,8 +319,8 @@ class AboutYourOrganizationForm(RegistrarForm):
|
|||
widget=forms.Textarea(),
|
||||
validators=[
|
||||
MaxLengthValidator(
|
||||
1000,
|
||||
message="Response must be less than 1000 characters.",
|
||||
2000,
|
||||
message="Response must be less than 2000 characters.",
|
||||
)
|
||||
],
|
||||
error_messages={"required": ("Enter more information about your organization.")},
|
||||
|
@ -515,8 +515,8 @@ class PurposeForm(RegistrarForm):
|
|||
widget=forms.Textarea(),
|
||||
validators=[
|
||||
MaxLengthValidator(
|
||||
1000,
|
||||
message="Response must be less than 1000 characters.",
|
||||
2000,
|
||||
message="Response must be less than 2000 characters.",
|
||||
)
|
||||
],
|
||||
error_messages={"required": "Describe how you’ll use the .gov domain you’re requesting."},
|
||||
|
@ -830,8 +830,8 @@ class AnythingElseForm(RegistrarForm):
|
|||
widget=forms.Textarea(),
|
||||
validators=[
|
||||
MaxLengthValidator(
|
||||
1000,
|
||||
message="Response must be less than 1000 characters.",
|
||||
2000,
|
||||
message="Response must be less than 2000 characters.",
|
||||
)
|
||||
],
|
||||
)
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block form_fields %}
|
||||
{% with attr_maxlength=1000 add_label_class="usa-sr-only" %}
|
||||
{% with attr_maxlength=2000 add_label_class="usa-sr-only" %}
|
||||
{% input_with_errors forms.0.about_your_organization %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
|
||||
{% block form_fields %}
|
||||
{% with add_label_class="usa-sr-only" attr_maxlength=1000 %}
|
||||
{% with attr_maxlength=2000 add_label_class="usa-sr-only" %}
|
||||
{% input_with_errors forms.0.anything_else %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block form_fields %}
|
||||
{% with attr_maxlength=1000 add_label_class="usa-sr-only" %}
|
||||
{% with attr_maxlength=2000 add_label_class="usa-sr-only" %}
|
||||
{% input_with_errors forms.0.purpose %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -226,7 +226,7 @@ class TestFormValidation(MockEppLib):
|
|||
)
|
||||
|
||||
def test_purpose_form_character_count_invalid(self):
|
||||
"""Response must be less than 1000 characters."""
|
||||
"""Response must be less than 2000 characters."""
|
||||
form = PurposeForm(
|
||||
data={
|
||||
"purpose": "Bacon ipsum dolor amet fatback strip steak pastrami"
|
||||
|
@ -247,15 +247,33 @@ class TestFormValidation(MockEppLib):
|
|||
"cow sausage ball tip kielbasa ham hock. Ball tip cupim meatloaf"
|
||||
"beef ribs rump jowl tenderloin swine sausage biltong"
|
||||
"bacon rump tail boudin meatball boudin meatball boudin."
|
||||
"Bacon ipsum dolor amet fatback strip steak pastrami"
|
||||
"shankle, drumstick doner chicken landjaeger turkey andouille."
|
||||
"Buffalo biltong chuck pork chop tongue bresaola turkey. Doner"
|
||||
"ground round strip steak, jowl tail chuck ribeye bacon"
|
||||
"beef ribs swine filet ball tip pancetta strip steak sirloin"
|
||||
"mignon ham spare ribs rump. Tail shank biltong beef ribs doner"
|
||||
"buffalo swine bacon. Tongue cow picanha brisket bacon chuck"
|
||||
"leberkas pork loin pork, drumstick capicola. Doner short loin"
|
||||
"ground round fatback turducken chislic shoulder turducken"
|
||||
"spare ribs, burgdoggen kielbasa kevin frankfurter ball tip"
|
||||
"pancetta cupim. Turkey meatball andouille porchetta hamburger"
|
||||
"pork chop corned beef. Brisket short ribs turducken, pork chop"
|
||||
"chislic turkey ball pork chop leberkas rump, rump bacon, jowl"
|
||||
"tip ham. Shankle salami tongue venison short ribs kielbasa"
|
||||
"tri-tip ham hock swine hamburger. Flank meatball corned beef"
|
||||
"cow sausage ball tip kielbasa ham hock. Ball tip cupim meatloaf"
|
||||
"beef ribs rump jowl tenderloin swine sausage biltong"
|
||||
"bacon rump tail boudin meatball boudin meatball boudin."
|
||||
}
|
||||
)
|
||||
self.assertEqual(
|
||||
form.errors["purpose"],
|
||||
["Response must be less than 1000 characters."],
|
||||
["Response must be less than 2000 characters."],
|
||||
)
|
||||
|
||||
def test_anything_else_form_about_your_organization_character_count_invalid(self):
|
||||
"""Response must be less than 1000 characters."""
|
||||
"""Response must be less than 2000 characters."""
|
||||
form = AnythingElseForm(
|
||||
data={
|
||||
"anything_else": "Bacon ipsum dolor amet fatback strip steak pastrami"
|
||||
|
@ -276,15 +294,32 @@ class TestFormValidation(MockEppLib):
|
|||
"cow sausage ball tip kielbasa ham hock. Ball tip cupim meatloaf"
|
||||
"beef ribs rump jowl tenderloin swine sausage biltong"
|
||||
"bacon rump tail boudin meatball boudin meatball boudin."
|
||||
"shankle, drumstick doner chicken landjaeger turkey andouille."
|
||||
"Buffalo biltong chuck pork chop tongue bresaola turkey. Doner"
|
||||
"ground round strip steak, jowl tail chuck ribeye bacon"
|
||||
"beef ribs swine filet ball tip pancetta strip steak sirloin"
|
||||
"mignon ham spare ribs rump. Tail shank biltong beef ribs doner"
|
||||
"buffalo swine bacon. Tongue cow picanha brisket bacon chuck"
|
||||
"leberkas pork loin pork, drumstick capicola. Doner short loin"
|
||||
"ground round fatback turducken chislic shoulder turducken"
|
||||
"spare ribs, burgdoggen kielbasa kevin frankfurter ball tip"
|
||||
"pancetta cupim. Turkey meatball andouille porchetta hamburger"
|
||||
"pork chop corned beef. Brisket short ribs turducken, pork chop"
|
||||
"chislic turkey ball pork chop leberkas rump, rump bacon, jowl"
|
||||
"tip ham. Shankle salami tongue venison short ribs kielbasa"
|
||||
"tri-tip ham hock swine hamburger. Flank meatball corned beef"
|
||||
"cow sausage ball tip kielbasa ham hock. Ball tip cupim meatloaf"
|
||||
"beef ribs rump jowl tenderloin swine sausage biltong"
|
||||
"bacon rump tail boudin meatball boudin meatball boudin."
|
||||
}
|
||||
)
|
||||
self.assertEqual(
|
||||
form.errors["anything_else"],
|
||||
["Response must be less than 1000 characters."],
|
||||
["Response must be less than 2000 characters."],
|
||||
)
|
||||
|
||||
def test_anything_else_form_character_count_invalid(self):
|
||||
"""Response must be less than 1000 characters."""
|
||||
"""Response must be less than 2000 characters."""
|
||||
form = AboutYourOrganizationForm(
|
||||
data={
|
||||
"about_your_organization": "Bacon ipsum dolor amet fatback"
|
||||
|
@ -306,11 +341,29 @@ class TestFormValidation(MockEppLib):
|
|||
"cow sausage ball tip kielbasa ham hock. Ball tip cupim meatloaf"
|
||||
"beef ribs rump jowl tenderloin swine sausage biltong"
|
||||
"bacon rump tail boudin meatball boudin meatball boudin."
|
||||
"strip steak pastrami"
|
||||
"shankle, drumstick doner chicken landjaeger turkey andouille."
|
||||
"Buffalo biltong chuck pork chop tongue bresaola turkey. Doner"
|
||||
"ground round strip steak, jowl tail chuck ribeye bacon"
|
||||
"beef ribs swine filet ball tip pancetta strip steak sirloin"
|
||||
"mignon ham spare ribs rump. Tail shank biltong beef ribs doner"
|
||||
"buffalo swine bacon. Tongue cow picanha brisket bacon chuck"
|
||||
"leberkas pork loin pork, drumstick capicola. Doner short loin"
|
||||
"ground round fatback turducken chislic shoulder turducken"
|
||||
"spare ribs, burgdoggen kielbasa kevin frankfurter ball tip"
|
||||
"pancetta cupim. Turkey meatball andouille porchetta hamburger"
|
||||
"pork chop corned beef. Brisket short ribs turducken, pork chop"
|
||||
"chislic turkey ball pork chop leberkas rump, rump bacon, jowl"
|
||||
"tip ham. Shankle salami tongue venison short ribs kielbasa"
|
||||
"tri-tip ham hock swine hamburger. Flank meatball corned beef"
|
||||
"cow sausage ball tip kielbasa ham hock. Ball tip cupim meatloaf"
|
||||
"beef ribs rump jowl tenderloin swine sausage biltong"
|
||||
"bacon rump tail boudin meatball boudin meatball boudin."
|
||||
}
|
||||
)
|
||||
self.assertEqual(
|
||||
form.errors["about_your_organization"],
|
||||
["Response must be less than 1000 characters."],
|
||||
["Response must be less than 2000 characters."],
|
||||
)
|
||||
|
||||
def test_your_contact_email_invalid(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue