From d84d4e056b2c04d9a5b0e1b1a7657ab1d26c00c3 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Wed, 17 Jun 2020 07:24:25 +0100 Subject: [PATCH] Added a test --- .../dao/notification_dao/test_notification_dao.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/app/dao/notification_dao/test_notification_dao.py b/tests/app/dao/notification_dao/test_notification_dao.py index 58bb218a9..95d72aefc 100644 --- a/tests/app/dao/notification_dao/test_notification_dao.py +++ b/tests/app/dao/notification_dao/test_notification_dao.py @@ -1630,6 +1630,12 @@ def test_dao_get_notification_by_reference_with_no_matches_raises_error(notify_d dao_get_notification_by_reference('REF1', 'email') +def test_dao_get_notification_by_reference_with_no_matches_for_type_raises_error(sample_email_template): + create_notification(template=sample_email_template, reference='REF1') + with pytest.raises(SQLAlchemyError): + dao_get_notification_by_reference('REF1', 'letter') + + def test_dao_get_notification_or_history_by_reference_with_one_match_returns_notification( sample_letter_template ): @@ -1649,7 +1655,13 @@ def test_dao_get_notification_or_history_by_reference_with_multiple_matches_rais dao_get_notification_or_history_by_reference('REF1', 'letter') -def test_dao_get_notification_or_history_by_reference_with_no_matches_raises_error(notify_db): +def test_dao_get_notification_or_history_by_reference_with_no_matches_raises_error(sample_letter_template): + create_notification(template=sample_letter_template, reference='REF1') + with pytest.raises(SQLAlchemyError): + dao_get_notification_or_history_by_reference('REF1', 'email') + + +def test_dao_get_notification_or_history_by_reference_with_no_matches_for_type_raises_error(notify_db): with pytest.raises(SQLAlchemyError): dao_get_notification_or_history_by_reference('REF1', 'email')