Skip to content

Commit

Permalink
test: [FC-0047] add check for push notif channel
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Jul 25, 2024
1 parent c1ea794 commit 9a8e9fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions edx_ace/tests/channel/test_channel_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from edx_ace.channel import ChannelMap, ChannelType, get_channel_for_message
from edx_ace.channel.braze import BrazeEmailChannel
from edx_ace.channel.file import FileEmailChannel
from edx_ace.channel.push_notification import PushNotificationChannel
from edx_ace.errors import UnsupportedChannelError
from edx_ace.message import Message
from edx_ace.recipient import Recipient
Expand Down Expand Up @@ -45,6 +46,7 @@ def test_get_channel_for_message(self):
channel_map = ChannelMap([
['file_email', FileEmailChannel()],
['braze_email', BrazeEmailChannel()],
['push_notifications', PushNotificationChannel()],
])

transactional_msg = Message(options={'transactional': True}, **self.msg_kwargs)
Expand All @@ -58,6 +60,7 @@ def test_get_channel_for_message(self):
assert isinstance(get_channel_for_message(ChannelType.EMAIL, transactional_msg), FileEmailChannel)
assert isinstance(get_channel_for_message(ChannelType.EMAIL, transactional_campaign_msg), BrazeEmailChannel)
assert isinstance(get_channel_for_message(ChannelType.EMAIL, info_msg), BrazeEmailChannel)
assert isinstance(get_channel_for_message(ChannelType.PUSH, info_msg), PushNotificationChannel)

with self.assertRaises(UnsupportedChannelError):
assert get_channel_for_message(ChannelType.PUSH, transactional_msg)
Expand Down

0 comments on commit 9a8e9fe

Please sign in to comment.