def test_mail_events_noop(self, mock_days_until, mock_send):

        mock_days_until.return_value = (20, self.event_pub)

        ical.mail_events('*****@*****.**')

        assert not mock_send.called
    def test_mail_events_admin(self, mock_days_until, mock_send):

        mock_days_until.return_value = (
            app.config['ADMIN_REMINDER_DAYS'], self.event_pub
        )

        with app.test_request_context('/send_email'):
            ical.mail_events('*****@*****.**')

        self.assertEqual(mock_send.call_count, 1)
Exemple #3
0
def mailer():
    mail_events()
    def test_mail_no_events(self, mock_send):

        with app.test_request_context('/send_email'):
            ical.mail_events('*****@*****.**')

        self.assertEqual(mock_send.call_count, 1)