make tests use mmg 100% of the time by default

we randomly choose between sms providers now - this means that tests may
sometimes send firetext and sometimes mmg, so we'd need to patch out
different HTTP calls, expect different values in sent_by, etc etc.

To ensure tests are consistent, add a new fixture that is always used by
notify_db_session, which sets the priorities of the sms providers to
100% mmg 0% firetext. if you need to test other values, then you should
set the values manually in the test file
This commit is contained in:
Leo Hemsted
2019-11-11 16:09:15 +00:00
parent e29546cb65
commit 52a33f220b
2 changed files with 21 additions and 9 deletions

View File

@@ -224,17 +224,17 @@ def test_dao_get_provider_stats(notify_db_session):
assert result[0].created_by_name is None
assert result[0].current_month_billable_sms == 0
assert result[1].identifier == 'mmg'
assert result[1].display_name == 'MMG'
assert result[1].supports_international is True
assert result[1].identifier == 'firetext'
assert result[1].notification_type == 'sms'
assert result[1].supports_international is False
assert result[1].active is True
assert result[1].current_month_billable_sms == 4
assert result[1].current_month_billable_sms == 5
assert result[2].identifier == 'firetext'
assert result[2].notification_type == 'sms'
assert result[2].supports_international is False
assert result[2].identifier == 'mmg'
assert result[2].display_name == 'MMG'
assert result[2].supports_international is True
assert result[2].active is True
assert result[2].current_month_billable_sms == 5
assert result[2].current_month_billable_sms == 4
assert result[3].identifier == 'dvla'
assert result[3].current_month_billable_sms == 0