Ignore:
Timestamp:
7 Oct 2012, 08:32:45 (12 years ago)
Author:
Henrik Bettermann
Message:

Enable sending emails to several email addresses all the with the same rcpt_name (Import Manager, Clearance Officer ...).

File:
1 edited

Legend:

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

    r8382 r9306  
    4545# Maybe existing receiver of externally sent mail. If this mail account
    4646# exists really, it might receive mail from the tests!
    47 EXTERNAL_MAIL_RECEIVER = 'no-user@waeup.org'
     47EXTERNAL_MAIL_RECEIVER = 'no-reply@waeup.org'
    4848
    4949# Names of mail deliveries to use when external mail tests are enabled.
     
    340340
    341341    @external_mail_test
     342    def test_send_direct_mails(self):
     343        # send several mails using direct mail delivery
     344        self.app['configuration'].smtp_mailer = EXTERNAL_DIRECT_DELIVERY
     345        setSite(self.app)
     346        result = send_mail(
     347            'test program', 'no-reply@waeup.org',
     348            'test mail receiver',
     349            '%s, %s' % (EXTERNAL_MAIL_RECEIVER, EXTERNAL_MAIL_RECEIVER),
     350            'Test Mail from WAeUP Kofa',
     351            'Hi from test mailer!\n\nRegards,\nTest Programme\n'
     352            )
     353        import transaction
     354        transaction.commit() # The mail is really sent when transactions is
     355                             # committed
     356        self.assertTrue('@' in result)
     357        return
     358
     359    @external_mail_test
    342360    def test_send_queued_mail(self):
    343361        # send mail using queued mail delivery
Note: See TracChangeset for help on using the changeset viewer.