Stop reversing the order of SMS providers

This makes no functional difference but does make it easier to read.
This commit is contained in:
Ben Thorner
2022-03-25 16:36:17 +00:00
parent 9355c4f8d1
commit 55e2a2f96b
2 changed files with 15 additions and 15 deletions

View File

@@ -66,7 +66,7 @@ def edit_sms_provider_ratio():
for provider in provider_client.get_all_providers()['provider_details'] for provider in provider_client.get_all_providers()['provider_details']
if provider['notification_type'] == 'sms' if provider['notification_type'] == 'sms'
and provider['active'] and provider['active']
], key=itemgetter('identifier'), reverse=True) ], key=itemgetter('identifier'))
form = AdminProviderRatioForm(ratio=providers[0]['priority']) form = AdminProviderRatioForm(ratio=providers[0]['priority'])

View File

@@ -445,15 +445,15 @@ def test_should_show_version_history_for_first_two_sms_providers(
) )
# we get only get version info for the "primary" (first) provider # we get only get version info for the "primary" (first) provider
# in reverse alphabetical order i.e. sms_provider_2 # in alphabetical order i.e. sms_provider_1
mocker.patch( mocker.patch(
'app.provider_client.get_provider_versions', 'app.provider_client.get_provider_versions',
return_value={'data': [ return_value={'data': [
{ {
'id': id, 'id': id,
'priority': priority, 'priority': priority,
'display_name': sms_provider_2['display_name'], 'display_name': sms_provider_1['display_name'],
'identifier': sms_provider_2['identifier'], 'identifier': sms_provider_1['identifier'],
'updated_at': updated_at, 'updated_at': updated_at,
'created_by': { 'created_by': {
'email_address': 'test@foo.bar', 'email_address': 'test@foo.bar',
@@ -490,7 +490,7 @@ def test_should_show_version_history_for_first_two_sms_providers(
radio['value'] radio['value']
for radio in page.select('input[checked]') for radio in page.select('input[checked]')
] == [ ] == [
str(sms_provider_2['priority']) str(sms_provider_1['priority'])
] ]
assert [ assert [
@@ -508,18 +508,18 @@ def test_should_show_version_history_for_first_two_sms_providers(
] == [ ] == [
( (
'Test User 2:00pm ' 'Test User 2:00pm '
'Second Domestic SMS Provider 100% ' 'First Domestic SMS Provider 100% '
'First Domestic SMS Provider 0%' 'Second Domestic SMS Provider 0%'
), ),
( (
'Test User 5:00am ' 'Test User 5:00am '
'Second Domestic SMS Provider 80% ' 'First Domestic SMS Provider 80% '
'First Domestic SMS Provider 20%' 'Second Domestic SMS Provider 20%'
), ),
( (
'Test User 3:00am ' 'Test User 3:00am '
'Second Domestic SMS Provider 10% ' 'First Domestic SMS Provider 10% '
'First Domestic SMS Provider 90%' 'Second Domestic SMS Provider 90%'
), ),
] ]
@@ -528,15 +528,15 @@ def test_should_show_version_history_for_first_two_sms_providers(
( (
'10', '10',
[ [
call(sms_provider_2['id'], 10), call(sms_provider_1['id'], 10),
call(sms_provider_1['id'], 90), call(sms_provider_2['id'], 90),
], ],
), ),
( (
'80', '80',
[ [
call(sms_provider_2['id'], 80), call(sms_provider_1['id'], 80),
call(sms_provider_1['id'], 20), call(sms_provider_2['id'], 20),
], ],
), ),
]) ])