refactor tests

re-order notification dao delete notifications test to move "fixtures"
to the top of the file

changed create_service_data_retention to take an ORM object, not an id.
brings it in line with other db.py test functions
This commit is contained in:
Leo Hemsted
2019-06-03 17:27:08 +01:00
parent 396149ddde
commit 67f171f2f8
7 changed files with 65 additions and 71 deletions

View File

@@ -141,8 +141,8 @@ def test_update_service_data_retention_does_not_update_row_if_data_retention_is_
('letter', 'sms')]
)
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)
data_retention = create_service_data_retention(service=sample_service, notification_type=notification_type)
create_service_data_retention(service=sample_service, notification_type=alternate)
result = fetch_service_data_retention_by_notification_type(sample_service.id, notification_type)
assert result == data_retention