Example #1
0
 def test_get_default_template(self):
     '''mail.get_template should return the default template if one is set and no input ovverrides it'''
     conf.default_template = 'tongs'
     self.assertEqual(get_template(None), conf.MAIL_TMPLS['tongs'])
     conf.default_template = None
Example #2
0
 def test_no_template(self):
     '''mail.get_template should return None if no args and no default'''
     from sendcrap.mail import type_mail as base_type_mail
     mail.type_mail = lambda: 'dummytyping'
     self.assertEqual(get_template(None), 'dummytyping')
     mail.type_mail = base_type_mail
Example #3
0
 def test_get_template(self):
     '''mail.get_template should return the right template'''
     for t in conf.MAIL_TMPLS.keys():
         self.assertEqual(get_template(t), conf.MAIL_TMPLS[t])