Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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)
Exemplo n.º 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)