Allow free allowance to be set to 0

We want to be able to set the free allowance for a service to 0, but the
form was not allowing this - it gave an error message of `Cannot be
empty`. This can be fixed by changing the WTForms validator from
`DataRequired` (which coerces 0 to falsey) to the `InputRequired`
validator.
This commit is contained in:
Katie Smith
2022-02-25 11:27:56 +00:00
parent 05b8fd7c01
commit 9dc3252079
2 changed files with 10 additions and 2 deletions

View File

@@ -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),