Exemplo n.º 1
0
class BaseMailTests(unittest.TestCase):

  def setUp(self):
    self.helper = TestUtils()
    self.sender = self.helper.getSender()
    self.bm = self.helper.getBaseMail()

  def testGetSenderMail(self):
    self.assertEquals(self.bm.getSenderMail(), self.sender.email)

  def testGetMailString(self):
    guestList = self.helper.getGuestList()
    to = guestList[0]
    giftTo = guestList[1]
    mailString = self.bm.getMailString(to, giftTo)
    self.assertEquals(type(mailString), str)
    self.assertIn("From: %s" % str(self.sender), mailString)
    self.assertIn("To: %s" % str(to), mailString)
    self.assertIn("Subject: %s" % self.bm.subject, mailString)
 def setUp(self):
   helper = TestUtils()
   self.guestList = helper.getGuestList()
   self.matches = helper.getMatchesDict()
   self.mailer = mox.MockObject(Mailer)
   self.baseMail = helper.getBaseMail()