Пример #1
0
 def test_get_server_with_altserver_set_and_login_needed(self):
     emailer = SmtpEmailer(user='******', password='******')
     mockserver = D3RParameters()
     mockserver.login = Mock()
     emailer.set_alternate_smtp_server(mockserver)
     emailer._get_server()
     mockserver.login.assert_called_once_with('bob', 'smith')
Пример #2
0
 def test_get_server_with_altserver_set(self):
     emailer = SmtpEmailer()
     fake = D3RParameters()
     fake.hi = 'fake'
     emailer.set_alternate_smtp_server(fake)
     self.assertEqual(emailer._get_server().hi, fake.hi)