mirror of
https://github.com/sartography/uva-covid19-testing-communicator.git
synced 2025-02-25 13:25:19 +00:00
17 lines
649 B
Python
17 lines
649 B
Python
|
from tests.base_test import BaseTest
|
||
|
|
||
|
|
||
|
from communicator import app
|
||
|
from communicator.models import Sample
|
||
|
from communicator.services.notification_service import TEST_MESSAGES, NotificationService
|
||
|
|
||
|
|
||
|
class TestNotificationService(BaseTest):
|
||
|
|
||
|
def test_send_notification(self):
|
||
|
message_count = len(TEST_MESSAGES)
|
||
|
notifier = NotificationService(app)
|
||
|
sample = Sample(email="dan@stauntonmakerspace.com", result_code="1234")
|
||
|
notifier.send_result_email(sample)
|
||
|
self.assertEqual(len(TEST_MESSAGES), message_count + 1)
|
||
|
self.assertEqual("UVA: BE SAFE Notification", self.decode(TEST_MESSAGES[-1]['subject']))
|