예제 #1
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 c3smembership.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,
            'address1': u'addr one',
            'address2': u'addr two',
            'postcode': u'12345 xyz',
            'city': u'Town',
            'email': u'*****@*****.**',
            'country': u'af',
            'member_of_colsoc': u'yes',
            'name_of_colsoc': u'Buma',
            #'invest_member': u'yes',
            'membership_type': u'investing',
            'num_shares': u"23",
            #'opt_band': u'the yes',
            #'opt_URL': u'http://the.yes',
            #'noticed_dataProtection': u'yes'
        }
        result = make_mail_body(my_appstruct)

        self.failUnless(u'Jöhn test_mail_body' in result)
        self.failUnless(u'Döe' in result)
        self.failUnless(u'postcode:                       12345 xyz' in result)
        self.failUnless(u'Town' in result)
        self.failUnless(u'*****@*****.**' in result)
        self.failUnless(u'af' in result)
        self.failUnless(u'number of shares                23' in result)
        self.failUnless(
            u'member of coll. soc.:           yes' in result)
        self.failUnless(u"that's it.. bye!" in result)
예제 #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 c3smembership.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,
            'address1': u'addr one',
            'address2': u'addr two',
            'postcode': u'12345 xyz',
            'city': u'Town',
            'email': u'*****@*****.**',
            'country': u'af',
            'member_of_colsoc': u'yes',
            'name_of_colsoc': u'Buma',
            #'invest_member': u'yes',
            'membership_type': u'investing',
            'num_shares': u"23",
            #'opt_band': u'the yes',
            #'opt_URL': u'http://the.yes',
            #'noticed_dataProtection': u'yes'
        }
        result = make_mail_body(my_appstruct)

        self.failUnless(u'Jöhn test_mail_body' in result)
        self.failUnless(u'Döe' in result)
        self.failUnless(u'postcode:                       12345 xyz' in result)
        self.failUnless(u'Town' in result)
        self.failUnless(u'*****@*****.**' in result)
        self.failUnless(u'af' in result)
        self.failUnless(u'number of shares                23' in result)
        self.failUnless(u'member of coll. soc.:           yes' in result)
        self.failUnless(u"that's it.. bye!" in result)
예제 #3
0
    def test_mail_body(self):
        """
        Test if mail body is constructed correctly and if umlauts work
        """
        from c3smembership.utils import make_mail_body
        import datetime
        dob = datetime.date(1999, 1, 1)
        member = C3sMember(
            firstname=u'Jöhn test_mail_body',
            lastname=u'Döe',
            email=u'*****@*****.**',
            password=u'very_unsecure_password',
            address1=u'addr one',
            address2=u'addr two',
            postcode=u'12345 xyz',
            city=u'Town',
            country=u'af',
            locale=u'en',
            date_of_birth=dob,
            email_is_confirmed=False,
            email_confirm_code=u'1234567890',
            num_shares=u'23',
            date_of_submission=datetime.datetime.now(),
            membership_type=u'investing',
            member_of_colsoc=u'yes',
            name_of_colsoc=u'Buma',
            privacy_consent=datetime.datetime.now(),
        )
        result = make_mail_body(member)

        self.failUnless(u'Jöhn test_mail_body' in result)
        self.failUnless(u'Döe' in result)
        self.failUnless(u'postcode:                       12345 xyz' in result)
        self.failUnless(u'Town' in result)
        self.failUnless(u'*****@*****.**' in result)
        self.failUnless(u'af' in result)
        self.failUnless(u'number of shares                23' in result)
        self.failUnless(
            u'member of coll. soc.:           yes' in result)
        self.failUnless(u'that\'s it.. bye!' in result)
예제 #4
0
    def test_mail_body(self):
        """
        test if mail body is constructed correctly
        and if umlauts work
        """
        from c3smembership.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,
            'address1': u'addr one',
            'address2': u'addr two',
            'postcode': u'12345 xyz',
            'city': u'Town',
            'email': u'*****@*****.**',
            'email_confirm_code': u'1234567890',
            'country': u'af',
            'member_of_colsoc': u'yes',
            'name_of_colsoc': u'Buma',
            'membership_type': u'investing',
            'num_shares': u"23",
            'date_of_submission': datetime.datetime.now(),
        }
        result = make_mail_body(my_appstruct)

        self.failUnless(u'Jöhn test_mail_body' in result)
        self.failUnless(u'Döe' in result)
        self.failUnless(u'postcode:                       12345 xyz' in result)
        self.failUnless(u'Town' in result)
        self.failUnless(u'*****@*****.**' in result)
        self.failUnless(u'af' in result)
        self.failUnless(u'number of shares                23' in result)
        self.failUnless(
            u'member of coll. soc.:           yes' in result)
        self.failUnless(u"that's it.. bye!" in result)
예제 #5
0
    def test_mail_body(self):
        """
        test if mail body is constructed correctly
        and if umlauts work
        """
        from c3smembership.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,
            'address1': u'addr one',
            'address2': u'addr two',
            'postcode': u'12345 xyz',
            'city': u'Town',
            'email': u'*****@*****.**',
            'email_confirm_code': u'1234567890',
            'country': u'af',
            'member_of_colsoc': u'yes',
            'name_of_colsoc': u'Buma',
            'membership_type': u'investing',
            'num_shares': u"23",
            'date_of_submission': datetime.datetime.now(),
        }
        result = make_mail_body(my_appstruct)

        self.failUnless(u'Jöhn test_mail_body' in result)
        self.failUnless(u'Döe' in result)
        self.failUnless(u'postcode:                       12345 xyz' in result)
        self.failUnless(u'Town' in result)
        self.failUnless(u'*****@*****.**' in result)
        self.failUnless(u'af' in result)
        self.failUnless(u'number of shares                23' in result)
        self.failUnless(u'member of coll. soc.:           yes' in result)
        self.failUnless(u"that's it.. bye!" in result)