Esempio n. 1
0
    def test_bulk_publish_notification(self, mock_parse_push):
        """
        Happy path testing of a bulk push notification
        """
        channel = ParsePushNotificationChannelProvider(application_id='foo',
                                                       rest_api_key='bar')

        channel.bulk_dispatch_notification(
            [_PARSE_SERVICE_USER_ID],
            self.msg,
            channel_context={'parse_channel_ids': ['test_channel_id']})
        self.assertTrue(mock_parse_push.alert.called)
        mock_parse_push.alert.assert_called_with(data=self.msg.payload,
                                                 channels=['test_channel_id'])
    def test_bulk_publish_notification(self, mock_parse_push):
        """
        Happy path testing of a bulk push notification
        """
        channel = ParsePushNotificationChannelProvider(application_id='foo', rest_api_key='bar')

        channel.bulk_dispatch_notification(
            [_PARSE_SERVICE_USER_ID],
            self.msg,
            channel_context={
                'parse_channel_ids': ['test_channel_id']
            }
        )
        self.assertTrue(mock_parse_push.alert.called)
        mock_parse_push.alert.assert_called_with(data=self.msg.payload, channels=['test_channel_id'])