Ignore:
Timestamp:
10 Apr 2014, 12:57:45 (11 years ago)
Author:
uli
Message:

When sending mail, use waeup.org address for from-field.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/tests/test_smtp.py

    r10855 r11585  
    5656#
    5757
     58
    5859def external_mail_test(func):
    5960    if not EXTERNAL_MAIL_TESTS:
     
    6566        return
    6667    return func
     68
    6769
    6870class HelperTests(unittest.TestCase):
     
    8688        # we can correctly encode address parts
    8789        result1 = encode_address('foo@bar.baz')
    88         result2 = encode_address(u'foo@bar.baz', 'The Foo' )
     90        result2 = encode_address(u'foo@bar.baz', 'The Foo')
    8991        result3 = encode_address('foo@bar.baz', u'The Foo')
    9092        result4 = encode_address('foo@bar.baz', u'With Umläut')
     
    141143        # they contain chars unrepresentable in ascii but available in latin1
    142144        text = u"Simple text with ü and capital pi: " + unichr(0x3a0)
    143         text = text.encode('utf-8') # turn unicode into byte stream
     145        text = text.encode('utf-8')  # turn unicode into byte stream
    144146        result1 = encode_body(text)
    145147        result1 = str(result1).split('\n')[1:]
     
    173175            u"Simple text with ü and capital pi: " + unichr(0x3a0))
    174176        return
     177
    175178
    176179class FunctionalMailerTests(FunctionalTestCase):
     
    233236        self.assertEqual(
    234237            self.get_fake_smtp_output().split('\n'),
    235             [u'Sending email from sender@example.com to recpt@example.com, sender@example.com:',
     238            [u'Sending email from sender@example.com to '
     239             u'recpt@example.com, sender@example.com:',
    236240             u'Message:',
    237241             u'msg: MIME-Version: 1.0',
    238242             u'msg: Content-Type: text/plain; charset="us-ascii"',
    239243             u'msg: Content-Transfer-Encoding: 7bit',
    240              u'msg: From: A sender <sender@example.com>',
     244             u'msg: From: A sender <no-reply@waeup.org>',
     245             u'msg: To: A recipient <recpt@example.com>',
    241246             u'msg: Cc: A sender <sender@example.com>',
    242              u'msg: To: A recipient <recpt@example.com>',
     247             u'msg: Reply-To: A sender <sender@example.com>',
    243248             u'msg: Subject: A subject',
    244249             u'msg: ',
     
    258263        self.assertEqual(
    259264            self.get_fake_smtp_output().split('\n'),
    260             [u'Sending email from sender@example.com to recpt@example.com, sender@example.com:',
     265            [u'Sending email from sender@example.com '
     266             u'to recpt@example.com, sender@example.com:',
    261267             u'Message:', u'msg: MIME-Version: 1.0',
    262268             u'msg: Content-Type: text/plain; charset="iso-8859-1"',
    263269             u'msg: Content-Transfer-Encoding: quoted-printable',
    264              u'msg: From: A sender <sender@example.com>',
     270             u'msg: From: A sender <no-reply@waeup.org>',
     271             u'msg: To: A recipient <recpt@example.com>',
    265272             u'msg: Cc: A sender <sender@example.com>',
    266              u'msg: To: A recipient <recpt@example.com>',
     273             u'msg: Reply-To: A sender <sender@example.com>',
    267274             u'msg: Subject: A subject',
    268275             u'msg: ',
     
    282289        self.assertEqual(
    283290            self.get_fake_smtp_output().split('\n'),
    284             [u'Sending email from sender@example.com to recpt@example.com, sender@example.com:',
     291            [u'Sending email from sender@example.com '
     292             u'to recpt@example.com, sender@example.com:',
    285293             u'Message:', u'msg: MIME-Version: 1.0',
    286294             u'msg: Content-Type: text/plain; charset="iso-8859-1"',
    287295             u'msg: Content-Transfer-Encoding: quoted-printable',
    288              u'msg: From: A sender <sender@example.com>',
     296             u'msg: From: A sender <no-reply@waeup.org>',
     297             u'msg: To: A recipient <recpt@example.com>',
    289298             u'msg: Cc: A sender <sender@example.com>',
    290              u'msg: To: A recipient <recpt@example.com>',
     299             u'msg: Reply-To: A sender <sender@example.com>',
    291300             u'msg: Subject: A subject',
    292301             u'msg: ',
     
    337346            )
    338347        import transaction
    339         transaction.commit() # The mail is really sent when transactions is
    340                              # committed
     348        transaction.commit()  # The mail is really sent when transactions is
     349                              # committed
    341350        self.assertTrue('@' in result)
    342351        return
     
    355364            )
    356365        import transaction
    357         transaction.commit() # The mail is really sent when transactions is
    358                              # committed
     366        transaction.commit()  # The mail is really sent when transactions is
     367                              # committed
    359368        self.assertTrue('@' in result)
    360369        return
     
    372381            )
    373382        import transaction
    374         transaction.commit() # The mail is really sent when transactions is
    375                              # committed
     383        transaction.commit()  # The mail is really sent when transactions is
     384                              # committed
    376385        self.assertTrue('@' in result)
    377386        return
Note: See TracChangeset for help on using the changeset viewer.