Revert "Purge notifications for configured days of retention"

This commit is contained in:
Rebecca Law
2018-08-03 14:35:36 +01:00
committed by GitHub
parent 691f24f94e
commit 019c6a4e3a
11 changed files with 148 additions and 337 deletions

View File

@@ -8,11 +8,10 @@ from app.dao.service_data_retention_dao import (
fetch_service_data_retention,
insert_service_data_retention,
update_service_data_retention,
fetch_service_data_retention_by_id,
fetch_service_data_retention_by_notification_type
fetch_service_data_retention_by_id
)
from app.models import ServiceDataRetention
from tests.app.db import create_service, create_service_data_retention
from tests.app.db import create_service
def test_fetch_service_data_retention(sample_service):
@@ -132,17 +131,3 @@ def test_update_service_data_retention_does_not_update_row_if_data_retention_is_
service_id=uuid.uuid4(),
days_of_retention=5)
assert updated_count == 0
@pytest.mark.parametrize('notification_type, alternate',
[('sms', 'email'),
('email', 'sms'), ('letter', 'email')])
def test_fetch_service_data_retention_by_notification_type(sample_service, notification_type, alternate):
data_retention = create_service_data_retention(service_id=sample_service.id, notification_type=notification_type)
create_service_data_retention(service_id=sample_service.id, notification_type=alternate)
result = fetch_service_data_retention_by_notification_type(sample_service.id, notification_type)
assert result == data_retention
def test_fetch_service_data_retention_by_notification_type_returns_none_when_no_rows(sample_service):
assert not fetch_service_data_retention_by_notification_type(sample_service.id, 'email')