Пример #1
0
    def test_mail_no_events(self, mock_days_until_next_event, mock_send):

        mock_days_until_next_event.side_effect = NoEvents("")

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

        mock_send.assert_called_once()
Пример #2
0
    def test_mail_events_admin(self, mock_days_until_next_event, mock_send):

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

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

        mock_send.assert_called_once()
Пример #3
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)
Пример #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)