Remove ‘human-readable’ phone number formatting

This has been removed from utils (so things will break if utils is
upgraded without this change isn’t made). I think it’s friendlier to
present the phone number as the user entered it anyway – because this is
what they think a ‘correct’ phone number representation looks like
anyway.
This commit is contained in:
Chris Hill-Scott
2017-04-26 16:19:34 +01:00
parent 3e72e0d722
commit de2886dbaf
2 changed files with 3 additions and 5 deletions

View File

@@ -60,9 +60,7 @@ def get_example_csv_fields(column_headers, use_example_as_example, submitted_fie
def get_example_csv_rows(template, use_example_as_example=True, submitted_fields=False):
return {
'email': ['test@example.com'] if use_example_as_example else [current_user.email_address],
'sms': ['07700 900321'] if use_example_as_example else [validate_and_format_phone_number(
current_user.mobile_number, human_readable=True
)],
'sms': ['07700 900321'] if use_example_as_example else [current_user.mobile_number],
'letter': [
(submitted_fields or {}).get(
key, get_example_letter_address(key) if use_example_as_example else key

View File

@@ -293,7 +293,7 @@ def test_send_test_sms_message(
fake_uuid
):
expected_data = {'data': 'phone number\r\n07700 900 762\r\n', 'file_name': 'Test message'}
expected_data = {'data': 'phone number\r\n07700 900762\r\n', 'file_name': 'Test message'}
mocker.patch('app.main.views.send.s3download', return_value='phone number\r\n+4412341234')
response = logged_in_client.get(
@@ -344,7 +344,7 @@ def test_send_test_sms_message_with_placeholders(
):
expected_data = {
'data': 'phone number,name\r\n07700 900 762,Jo\r\n',
'data': 'phone number,name\r\n07700 900762,Jo\r\n',
'file_name': 'Test message'
}
mocker.patch('app.main.views.send.s3download', return_value='phone number\r\n+4412341234')