diff --git a/app/main/forms.py b/app/main/forms.py index f6f7412a2..2c89859a4 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -40,7 +40,14 @@ from wtforms import ( ValidationError, validators, ) -from wtforms.validators import URL, DataRequired, Length, Optional, Regexp +from wtforms.validators import ( + URL, + DataRequired, + InputRequired, + Length, + Optional, + Regexp, +) from app.formatters import format_thousands, guess_name_from_email_address from app.main.validators import ( @@ -1300,7 +1307,7 @@ class FreeSMSAllowance(StripWhitespaceForm): free_sms_allowance = GovukIntegerField( 'Numbers of text message fragments per year', validators=[ - DataRequired(message='Cannot be empty') + InputRequired(message='Cannot be empty') ] ) diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 1ead2e1f4..9d22a36ec 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -3800,6 +3800,7 @@ def test_should_show_page_to_set_sms_allowance( @freeze_time("2017-04-01 11:09:00.061258") @pytest.mark.parametrize('given_allowance, expected_api_argument', [ + ('0', 0), ('1', 1), ('250000', 250000), pytest.param('foo', 'foo', marks=pytest.mark.xfail),