add actual_template relationship to notification

also renamed the function to make it apparent that it'll join and grab personalisation
This commit is contained in:
Leo Hemsted
2016-08-09 13:07:48 +01:00
parent c820938ced
commit 46c0728b12
6 changed files with 43 additions and 22 deletions

View File

@@ -23,7 +23,7 @@ from app.models import (
from app.dao.notifications_dao import (
dao_create_notification,
dao_update_notification,
get_notification,
get_notification_with_personalisation,
get_notification_for_job,
get_notifications_for_job,
dao_get_notification_statistics_for_service,
@@ -57,7 +57,7 @@ def test_should_have_decorated_notifications_dao_functions():
assert update_notification_status_by_reference.__wrapped__.__name__ == 'update_notification_status_by_reference' # noqa
assert get_notification_for_job.__wrapped__.__name__ == 'get_notification_for_job' # noqa
assert get_notifications_for_job.__wrapped__.__name__ == 'get_notifications_for_job' # noqa
assert get_notification.__wrapped__.__name__ == 'get_notification' # noqa
assert get_notification_with_personalisation.__wrapped__.__name__ == 'get_notification_with_personalisation' # noqa
assert get_notifications_for_service.__wrapped__.__name__ == 'get_notifications_for_service' # noqa
assert get_notification_by_id.__wrapped__.__name__ == 'get_notification_by_id' # noqa
assert delete_notifications_created_more_than_a_week_ago.__wrapped__.__name__ == 'delete_notifications_created_more_than_a_week_ago' # noqa
@@ -637,9 +637,11 @@ def test_save_notification_with_no_job(sample_template, mmg_provider):
def test_get_notification(sample_notification):
notification_from_db = get_notification(
notification_from_db = get_notification_with_personalisation(
sample_notification.service.id,
sample_notification.id)
sample_notification.id,
key_type=None
)
assert sample_notification == notification_from_db