Esempio n. 1
0
 def test_mail_body(self):
     """
     test if mail body is constructed correctly
     and if umlauts work
     """
     from c3sintent.utils import make_mail_body
     my_appstruct = {
         'activity': ['composer', 'dj'],
         'firstname': u'John',
         'lastname': u'Döe',
         'address1': u'In the Middle',
         'address2': u'Of Nowhereß',
         'postCode': u'12345',
         'city': u'Town',
         'email': u'*****@*****.**',
         'region': u'Hessen',
         'country': 'af',
         'at_least_three_works': 'yes',
         'member_of_colsoc': 'yes',
         'understood_declaration': 'yes',
         'consider_joining': 'yes',
         'noticed_dataProtection': 'yes'
         }
     result = make_mail_body(my_appstruct)
     #print(result)
     self.failUnless(u'composer, ' in unicode(result))
     self.failUnless(u'dj, ' in unicode(result))
     self.failUnless(u'John' in unicode(result))
     self.failUnless(u'Döe' in unicode(result))
     self.failUnless(u'In the Middle' in unicode(result))
     self.failUnless(u'Of Nowhereß' in unicode(result))
     self.failUnless(u'12345' in unicode(result))
     self.failUnless(u'Town' in unicode(result))
     self.failUnless(u'*****@*****.**' in unicode(result))
     self.failUnless(u'Hessen' in unicode(result))
     self.failUnless(u'af' in unicode(result))
     self.failUnless(
         u'created3:                       yes' in unicode(result))
     self.failUnless(
         u'member of coll. soc.:           yes' in unicode(result))
     self.failUnless(
         u'understood declaration:         yes' in unicode(result))
     self.failUnless(
         u'consider joining                yes' in unicode(result))
     self.failUnless(
         u'noticed data protection:        yes' in unicode(result))
     self.failUnless(u"that's it.. bye!" in unicode(result))
Esempio n. 2
0
 def test_mail_body(self):
     """
     test if mail body is constructed correctly
     and if umlauts work
     """
     #print("test_utils.py:TestUtilities.test_mail_body:\n")
     from c3sintent.utils import make_mail_body
     import datetime
     dob = datetime.date(1999, 1, 1)
     my_appstruct = {
         'activity': [u'composer', u'dj'],
         'firstname': u'Jöhn test_mail_body',
         'lastname': u'Döe',
         'date_of_birth': dob,
         'city': u'Town',
         'email': u'*****@*****.**',
         'country': u'af',
         'member_of_colsoc': u'yes',
         'name_of_colsoc': u'Hessen',
         'invest_member': u'yes',
         'opt_band': u'the yes',
         'opt_URL': u'http://the.yes',
         'noticed_dataProtection': u'yes'
     }
     result = make_mail_body(my_appstruct)
     #print("test_mail_body: result: \n %s") % result
     self.failUnless(u'composer, ' in result)
     self.failUnless(u'dj, ' in result)
     self.failUnless(u'Jöhn test_mail_body' in result)
     self.failUnless(u'Döe' in result)
     self.failUnless(u'Town' in result)
     self.failUnless(u'*****@*****.**' in result)
     self.failUnless(u'af' in result)
     self.failUnless(
         u'member of coll. soc.:           yes' in result)
     self.failUnless(
         u'noticed data protection:        yes' in result)
     self.failUnless(u"that's it.. bye!" in result)