Default new services to prefixing text messages

We want new services, when they do the tour, to see how the service name
they just made shows up in the messages. This is how it (should) work
at the moment (although got broken because of the multiple senders
stuff).

Need to do this before we do the migration now otherwise a new service
could sneak in with this setting still set to `null`.
This commit is contained in:
Chris Hill-Scott
2017-11-03 15:32:18 +00:00
parent ab583c0bc6
commit 812090b104
4 changed files with 17 additions and 13 deletions

View File

@@ -1562,18 +1562,18 @@ def test_set_sms_sender_for_service_rejects_null(client, sample_service):
assert result['message'] == {'sms_sender': ['Field may not be null.']}
@pytest.mark.parametrize('default_sms_sender, should_prefix', [
(None, True), # None means use default
('Foo', False),
@pytest.mark.parametrize('service_attribute, should_prefix', [
(True, True),
(False, False),
])
def test_prefixing_messages_based_on_sms_sender(
client,
notify_db_session,
default_sms_sender,
service_attribute,
should_prefix,
):
service = create_service(
sms_sender=default_sms_sender or current_app.config['FROM_NUMBER']
prefix_sms=service_attribute
)
create_service_sms_sender(
service=service,