コード例 #1
0
    def test_setup_delivery__settings(self):
        from nuorisovaalitadmin.sendmail import _setup_delivery

        mailer = _setup_delivery().mailer
        self.assertEquals('my-host', mailer.hostname)
        self.assertEquals(1025, mailer.port)
        self.assertEquals(True, mailer.debug_smtp)
コード例 #2
0
    def test_send_mail__call_delegates_with_params(self):
        from nuorisovaalitadmin import sendmail

        self.failUnless(sendmail._delivery is None)
        sendmail._delivery = sendmail._setup_delivery()
        self.failIf(sendmail._delivery is None)

        # Assert that calls to function delegate get passed to the delivery object.
        sendmail._delivery.send = mock.Mock()
        sendmail.send_mail(u'foo', u'bar', foo=1, bar=2)
        sendmail._delivery.send.assert_called_once_with(u'foo', u'bar', foo=1, bar=2)
コード例 #3
0
    def test_setup_delivery__settings(self):
        from nuorisovaalitadmin.sendmail import _setup_delivery

        mailer = _setup_delivery().mailer
        self.assertEquals(25, mailer.port)