Ejemplo n.º 1
0
    def test_notification_send_single(self, send, send_email, render_template):
        """Test non-multi only builds one message even with multiple emails
        """
        notification = Notification(to_email=["*****@*****.**", "*****@*****.**"], from_email="*****@*****.**")

        notification.build_msg = Mock()
        notification.build_msg.return_value = []

        # should build two messages on multi send
        notification.send(multi=False)
        self.assertTrue(notification.build_msg.called)
        self.assertEquals(notification.build_msg.call_count, 1)
Ejemplo n.º 2
0
    def test_notification_send_multi(self, send, send_email, render_template):
        '''Test multi builds multiple message objects
        '''
        notification = Notification(to_email=['*****@*****.**', '*****@*****.**'], from_email='*****@*****.**')

        notification.build_msg = Mock()
        notification.build_msg.return_value = []

        # should build two messages on multi send
        notification.send(multi=True)
        self.assertTrue(notification.build_msg.called)
        self.assertEquals(notification.build_msg.call_count, 2)
Ejemplo n.º 3
0
    def test_notification_send_multi(self, send, send_email, render_template):
        """Test multi builds multiple message objects
        """
        notification = Notification(to_email=["*****@*****.**", "*****@*****.**"], from_email="*****@*****.**")

        notification.build_msg = Mock()
        notification.build_msg.return_value = []

        # should build two messages on multi send
        notification.send(multi=True)
        self.assertTrue(notification.build_msg.called)
        self.assertEquals(notification.build_msg.call_count, 2)
Ejemplo n.º 4
0
    def test_notification_send_single(self, send, send_email, render_template):
        '''Test non-multi only builds one message even with multiple emails
        '''
        notification = Notification(to_email=['*****@*****.**', '*****@*****.**'], from_email='*****@*****.**')

        notification.build_msg = Mock()
        notification.build_msg.return_value = []

        # should build two messages on multi send
        notification.send(multi=False)
        self.assertTrue(notification.build_msg.called)
        self.assertEquals(notification.build_msg.call_count, 1)