Example #1
0
    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
Example #2
0
    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)
Example #3
0
def mailer():
    mail_events()
Example #4
0
    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)