Remove redundant test for letter usage breakdown

This is covered sufficiently by the main "test_usage" assertions,
which prove the usage is broken down by postage.

I don't think we need to explicitly test the usage is broken down
by month as we already prove this for SMS and we also check the
usage is associated with the correct month in the "ordering" test.
This commit is contained in:
Ben Thorner
2022-05-03 12:45:19 +01:00
parent 91e902bc2c
commit 63c35ec3d9

View File

@@ -1176,79 +1176,6 @@ def test_usage_page_displays_letters_ordered_by_postage(
assert normalize_spaces(postage_details[4].text) == '7 international letters at £1.50'
@freeze_time("2012-07-30 12:12:12")
def test_usage_page_displays_letters_split_by_month_and_postage(
mocker,
client_request,
service_one,
mock_get_annual_usage_for_service,
mock_get_free_sms_fragment_limit
):
billable_units_resp = [
{
'month': 'April',
'notification_type': 'letter',
'rate': 0.5,
'chargeable_units': 1,
'notifications_sent': 1,
'postage': 'second',
'letter_cost': 0.5,
},
{
'month': 'April',
'notification_type': 'letter',
'rate': 1,
'chargeable_units': 1,
'notifications_sent': 1,
'postage': 'europe',
'letter_cost': 1,
},
{
'month': 'May',
'notification_type': 'letter',
'rate': 1,
'chargeable_units': 7,
'notifications_sent': 7,
'postage': 'europe',
'letter_cost': 7,
},
{
'month': 'May',
'notification_type': 'letter',
'rate': 0.5,
'chargeable_units': 3,
'notifications_sent': 3,
'postage': 'second',
'letter_cost': 1.5,
},
{
'month': 'May',
'notification_type': 'letter',
'rate': 0.7,
'chargeable_units': 1,
'notifications_sent': 1,
'postage': 'first',
'letter_cost': 0.7,
},
]
mocker.patch('app.billing_api_client.get_monthly_usage_for_service', return_value=billable_units_resp)
service_one['permissions'].append('letter')
page = client_request.get(
'main.usage',
service_id=SERVICE_ONE_ID,
)
april_row = normalize_spaces(page.find('table').find_all('tr')[1].text)
may_row = normalize_spaces(page.find('table').find_all('tr')[2].text)
assert '1 second class letter at 50p' in april_row
assert '1 international letter at £1.00' in april_row
assert '1 first class letter at 70p' in may_row
assert '3 second class letters at 50p' in may_row
assert '7 international letters at £1.00' in may_row
def test_usage_page_with_0_free_allowance(
mocker,
client_request,