Exemplo n.º 1
0
    def test_send_notification(self):

        notification.send_notification(
            self.user['uri'],
            'Notification subject',
            'Notification text',
            '<html>Some HTML</html>',
            'The Badge Sender'
        )
        self.assertEquals(len(mail.outbox), 1)
        self.assertEquals(mail.outbox[0].subject, 'Notification subject')
Exemplo n.º 2
0
    def test_send_notification(self):
        with patch('requests.post') as requests_post:
            requests_post.return_value.status_code = 200

            ret = models.send_notification(
                '/uri/user/testuser',
                'Notification subject',
                'Notification text',
                '<html></html>',
                'The Sender',
                'http://call.me'
            )
            self.assertTrue(ret)
            self.assertTrue(requests_post.called)