mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Convert radios on SMS prefix page
Includes changing form.enabled to use OnOffField, for consistency with other on/off fields. OnOffField's data is a boolean, not a string, so some of the logic using it needed to be changed.
This commit is contained in:
@@ -4450,22 +4450,21 @@ def test_show_sms_prefixing_setting_page(
|
||||
)
|
||||
radios = page.select('input[type=radio]')
|
||||
assert len(radios) == 2
|
||||
assert radios[0]['value'] == 'on'
|
||||
assert radios[0]['value'] == 'True'
|
||||
assert radios[0]['checked'] == ''
|
||||
assert radios[1]['value'] == 'off'
|
||||
assert radios[1]['value'] == 'False'
|
||||
with pytest.raises(KeyError):
|
||||
assert radios[1]['checked']
|
||||
|
||||
|
||||
@pytest.mark.parametrize('post_value, expected_api_argument', [
|
||||
('on', True),
|
||||
('off', False),
|
||||
@pytest.mark.parametrize('post_value', [
|
||||
True,
|
||||
False,
|
||||
])
|
||||
def test_updates_sms_prefixing(
|
||||
client_request,
|
||||
mock_update_service,
|
||||
post_value,
|
||||
expected_api_argument,
|
||||
):
|
||||
client_request.post(
|
||||
'main.service_set_sms_prefix', service_id=SERVICE_ONE_ID,
|
||||
@@ -4477,7 +4476,7 @@ def test_updates_sms_prefixing(
|
||||
)
|
||||
mock_update_service.assert_called_once_with(
|
||||
SERVICE_ONE_ID,
|
||||
prefix_sms=expected_api_argument,
|
||||
prefix_sms=post_value,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user