示例#1
0
    def test_sends_sendgrid_email(self):
        """
        Call notifications.send_email_sendgrid with fixture parameters
        and check that SendGridClient is properly called.
        """

        with mock.patch('sendgrid.SendGridClient') as SendgridClient:
            notifications.send_email_sendgrid(*self.notification_args)

            SendgridClient.assert_called_once_with("Nikola", "jahuS", raise_errors=True)
            self.assertTrue(SendgridClient.return_value.send.called)
示例#2
0
    def test_sends_sendgrid_email(self):
        """
        Call notifications.send_email_sendgrid with fixture parameters
        and check that SendGridAPIClient is properly called.
        """

        with mock.patch('sendgrid.SendGridAPIClient') as SendGridAPIClient:
            notifications.send_email_sendgrid(*self.notification_args)

            SendGridAPIClient.assert_called_once_with("456abcdef123")
            self.assertTrue(SendGridAPIClient.return_value.send.called)
示例#3
0
    def test_sends_sendgrid_email(self):
        """
        Call notificaions.send_email_sendgrid with fixture parameters
        and check that SendGridClient is properly called.
        """

        with mock.patch('sendgrid.SendGridClient') as SendgridClient:
            notifications.send_email_sendgrid(configuration.get_config(),
                                              *self.notification_args)

            SendgridClient.assert_called_once_with("Nikola", "jahuS", raise_errors=True)
            self.assertTrue(SendgridClient.return_value.send.called)