diff --git a/app/main/views/notifications.py b/app/main/views/notifications.py index 881c14ba4..29f5bda5f 100644 --- a/app/main/views/notifications.py +++ b/app/main/views/notifications.py @@ -59,7 +59,6 @@ def view_notification(service_id, notification_id): filetype='png', ), ), - status=request.args.get('status'), updates_url=url_for( ".view_notification_updates", service_id=service_id, @@ -80,49 +79,10 @@ def view_notification_updates(service_id, notification_id): )) -def _get_single_notification_counts(notification, help_argument): - return [ - ( - label, - query_param, - url_for( - ".view_notification", - service_id=notification['service'], - notification_id=notification['id'], - status=query_param, - help=help_argument - ), - count - ) for label, query_param, count in [ - [ - 'total', '', - 1 - ], - [ - 'sending', 'sending', - int(notification['status'] in SENDING_STATUSES) - ], - [ - 'delivered', 'delivered', - int(notification['status'] in DELIVERED_STATUSES) - ], - [ - 'failed', 'failed', - int(notification['status'] in FAILURE_STATUSES) - ] - ] - ] - - def get_single_notification_partials(notification): status_args = get_status_arg(request.args) return { - 'counts': render_template( - 'partials/count.html', - counts=_get_single_notification_counts(notification, request.args.get('help', 0)), - status=status_args - ), 'notifications': render_template( 'partials/notifications/notifications.html', notification=notification, diff --git a/app/templates/views/notifications/notification.html b/app/templates/views/notifications/notification.html index f4936fb53..4a60fd1bd 100644 --- a/app/templates/views/notifications/notification.html +++ b/app/templates/views/notifications/notification.html @@ -16,7 +16,6 @@ {{ template|string }} {{ ajax_block(partials, updates_url, 'status', finished=finished) }} - {{ ajax_block(partials, updates_url, 'counts', finished=finished) }} {{ ajax_block(partials, updates_url, 'notifications', finished=finished) }} {{ page_footer( diff --git a/tests/app/main/views/test_notifications.py b/tests/app/main/views/test_notifications.py index c03b4969a..e72396cba 100644 --- a/tests/app/main/views/test_notifications.py +++ b/tests/app/main/views/test_notifications.py @@ -13,23 +13,6 @@ from app.utils import ( from tests.conftest import mock_get_notification -@pytest.mark.parametrize('multidict_args, expected_statuses', [ - ([], REQUESTED_STATUSES), - ([('status', '')], REQUESTED_STATUSES), - ([('status', 'garbage')], REQUESTED_STATUSES), - ([('status', 'sending')], SENDING_STATUSES), - ([('status', 'delivered')], DELIVERED_STATUSES), - ([('status', 'failed')], FAILURE_STATUSES), -]) -def test_status_filters(mocker, multidict_args, expected_statuses): - mocker.patch('app.main.views.notifications.current_app') - - args = MultiDict(multidict_args) - args['status'] = get_status_arg(args) - - assert sorted(args['status']) == sorted(expected_statuses) - - @freeze_time("2016-01-01 11:09:00.061258") def test_notification_status_page_shows_details( client_request, @@ -50,29 +33,3 @@ def test_notification_status_page_shows_details( service_one['id'], fake_uuid ) - - -@pytest.mark.parametrize('notification_status, expected_big_number_vals', [ - ('created', [1, 1, 0, 0]), - ('sending', [1, 1, 0, 0]), - ('delivered', [1, 0, 1, 0]), - ('temporary-failure', [1, 0, 0, 1]), -]) -def test_notification_status_page_shows_correct_numbers( - client_request, - mocker, - service_one, - fake_uuid, - notification_status, - expected_big_number_vals -): - mock_get_notification(mocker, fake_uuid, notification_status=notification_status) - - page = client_request.get( - 'main.view_notification', - service_id=service_one['id'], - notification_id=fake_uuid - ) - - big_numbers = page.find_all('div', {'class': 'big-number-number'}) - assert expected_big_number_vals == [int(num.text.strip()) for num in big_numbers]