diff --git a/tests/app/celery/test_provider_tasks.py b/tests/app/celery/test_provider_tasks.py index d4a9070bf..f920cb5d8 100644 --- a/tests/app/celery/test_provider_tasks.py +++ b/tests/app/celery/test_provider_tasks.py @@ -89,7 +89,6 @@ def test_should_retry_and_log_exception_for_non_SmsClientResponseException_excep assert mock_logger_exception.called -@pytest.mark.skip(reason="Needs updating for TTS: Failing for unknown reason") def test_should_go_into_technical_error_if_exceeds_retries_on_deliver_sms_task(sample_notification, mocker): mocker.patch('app.delivery.send_to_providers.send_sms_to_provider', side_effect=Exception("EXPECTED")) mocker.patch('app.celery.provider_tasks.deliver_sms.retry', side_effect=MaxRetriesExceededError()) @@ -128,7 +127,6 @@ def test_should_add_to_retry_queue_if_notification_not_found_in_deliver_email_ta app.celery.provider_tasks.deliver_email.retry.assert_called_with(queue="retry-tasks") -@pytest.mark.skip(reason="Needs updating for TTS: Failing for unknown reason") @pytest.mark.parametrize( 'exception_class', [ Exception(), @@ -150,7 +148,6 @@ def test_should_go_into_technical_error_if_exceeds_retries_on_deliver_email_task assert sample_notification.status == 'technical-failure' -@pytest.mark.skip(reason="Needs updating for TTS: Failing for unknown reason") def test_should_technical_error_and_not_retry_if_EmailClientNonRetryableException(sample_notification, mocker): mocker.patch( 'app.delivery.send_to_providers.send_email_to_provider', diff --git a/tests/app/celery/test_reporting_tasks.py b/tests/app/celery/test_reporting_tasks.py index f9e3ef0eb..02f5c0e2a 100644 --- a/tests/app/celery/test_reporting_tasks.py +++ b/tests/app/celery/test_reporting_tasks.py @@ -237,8 +237,7 @@ def test_create_nightly_billing_for_day_different_templates( assert record.rate_multiplier == multiplier[i] -@pytest.mark.skip(reason="Needs updating for TTS: Timezone handling") -def test_create_nightly_billing_for_day_different_sent_by( +def test_create_nightly_billing_for_day_same_sent_by( sample_service, sample_template, sample_email_template, @@ -273,12 +272,12 @@ def test_create_nightly_billing_for_day_different_sent_by( create_nightly_billing_for_day(str(yesterday.date())) records = FactBilling.query.order_by('rate_multiplier').all() - assert len(records) == 2 + assert len(records) == 1 for _, record in enumerate(records): assert record.local_date == datetime.date(yesterday) assert record.rate == Decimal(1.33) - assert record.billable_units == 1 + assert record.billable_units == 2 assert record.rate_multiplier == 1.0 diff --git a/tests/app/organisation/test_invite_rest.py b/tests/app/organisation/test_invite_rest.py index a3e544370..905fa016f 100644 --- a/tests/app/organisation/test_invite_rest.py +++ b/tests/app/organisation/test_invite_rest.py @@ -10,7 +10,6 @@ from tests import create_admin_authorization_header from tests.app.db import create_invited_org_user -@pytest.mark.skip(reason="Needs updating for TTS: Failing for unknown reason") @pytest.mark.parametrize('platform_admin, expected_invited_by', ( (True, 'The GOV.UK Notify team'), (False, 'Test User') diff --git a/tests/app/performance_dashboard/test_rest.py b/tests/app/performance_dashboard/test_rest.py index 5ac33c1b0..0fe55dc04 100644 --- a/tests/app/performance_dashboard/test_rest.py +++ b/tests/app/performance_dashboard/test_rest.py @@ -1,7 +1,5 @@ from datetime import date -import pytest - from tests.app.db import ( create_ft_notification_status, create_process_time, @@ -9,11 +7,9 @@ from tests.app.db import ( ) -@pytest.mark.skip(reason="Needs updating for TTS: Needs updating for new providers") def test_performance_dashboard(sample_service, admin_request): template_sms = create_template(service=sample_service, template_type='sms', template_name='a') template_email = create_template(service=sample_service, template_type='email', template_name='b') - template_letter = create_template(service=sample_service, template_type='letter', template_name='c') create_ft_notification_status(local_date=date(2021, 2, 28), service=template_email.service, template=template_email, @@ -22,10 +18,6 @@ def test_performance_dashboard(sample_service, admin_request): service=template_sms.service, template=template_sms, count=5) - create_ft_notification_status(local_date=date(2021, 2, 28), - service=template_letter.service, - template=template_letter, - count=2) create_ft_notification_status(local_date=date(2021, 3, 1), service=template_email.service, template=template_email, @@ -34,10 +26,6 @@ def test_performance_dashboard(sample_service, admin_request): service=template_sms.service, template=template_sms, count=20) - create_ft_notification_status(local_date=date(2021, 3, 1), - service=template_letter.service, - template=template_letter, - count=3) create_ft_notification_status(local_date=date(2021, 3, 2), service=template_email.service, template=template_email, @@ -46,10 +34,6 @@ def test_performance_dashboard(sample_service, admin_request): service=template_sms.service, template=template_sms, count=30) - create_ft_notification_status(local_date=date(2021, 3, 2), - service=template_letter.service, - template=template_letter, - count=10) create_ft_notification_status(local_date=date(2021, 3, 3), service=template_email.service, template=template_email, @@ -58,10 +42,6 @@ def test_performance_dashboard(sample_service, admin_request): service=template_sms.service, template=template_sms, count=35) - create_ft_notification_status(local_date=date(2021, 3, 3), - service=template_letter.service, - template=template_letter, - count=15) create_process_time(local_date='2021-02-28', messages_total=15, messages_within_10_secs=14) create_process_time(local_date='2021-03-01', messages_total=35, messages_within_10_secs=34) @@ -72,13 +52,12 @@ def test_performance_dashboard(sample_service, admin_request): start_date='2021-03-01', end_date='2021-03-02') - assert results['total_notifications'] == 10+5+2+15+20+3+25+30+10+45+35+15 + assert results['total_notifications'] == 185 assert results['email_notifications'] == 10+15+25+45 assert results['sms_notifications'] == 5+20+30+35 - assert results['letter_notifications'] == 2+3+10+15 - assert results['notifications_by_type'] == [{"date": '2021-03-01', "emails": 15, "sms": 20, "letters": 3}, - {"date": '2021-03-02', "emails": 25, "sms": 30, "letters": 10}] - assert results['processing_time'] == [{"date": "2021-03-01", "percentage_under_10_seconds": 97.1428571428571}, + assert results['notifications_by_type'] == [{"date": '2021-03-01', "emails": 15, "sms": 20}, + {"date": '2021-03-02', "emails": 25, "sms": 30}] + assert results['processing_time'] == [{"date": "2021-03-01", "percentage_under_10_seconds": 97.14285714285714}, {"date": "2021-03-02", "percentage_under_10_seconds": 80.0}] assert results["live_service_count"] == 1 assert results["services_using_notify"][0]["service_name"] == sample_service.name diff --git a/tests/app/test_route_authentication.py b/tests/app/test_route_authentication.py index f1c2dec56..e8ed40583 100644 --- a/tests/app/test_route_authentication.py +++ b/tests/app/test_route_authentication.py @@ -1,8 +1,3 @@ - -import pytest - - -@pytest.mark.skip(reason="Needs updating for TTS") def test_all_routes_have_authentication(client): # This tests that each blueprint registered on the application has a before_request function registered. # The None row is removed from the comparison as that is not blueprint specific but app specific.