Changeset 16213 for main


Ignore:
Timestamp:
25 Aug 2020, 15:18:15 (4 years ago)
Author:
Henrik Bettermann
Message:

Remove contact email header and add footer.

Location:
main/waeup.kofa/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r16193 r16213  
    441.6.1.dev0 (unreleased)
    55=======================
     6
     7* Remove contact email header and add footer.
    68
    79* Implement webservice `get_payment`.
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r16194 r16213  
    2828import os
    2929import grok
     30import logging
    3031from zc.async.testing import wait_for_result
    3132from zope.event import notify
     
    452453    # Tests for Student class views and pages
    453454
     455    def setUp(self):
     456        super(OfficerUITests, self).setUp()
     457        self.setup_logging()
     458        return
     459
     460    def tearDown(self):
     461        super(OfficerUITests, self).tearDown()
     462        self.teardown_logging()
     463        return
     464
     465    def setup_logging(self):
     466        # setup a log-handler that catches all fake mailer output
     467        self.stream = StringIO()
     468        handler = logging.StreamHandler(self.stream)
     469        logger = logging.getLogger('test.smtp')
     470        logger.addHandler(handler)
     471        logger.setLevel(logging.INFO)
     472        return
     473
     474    def get_fake_smtp_output(self):
     475        # get output generated by fake mailer
     476        self.stream.flush()
     477        self.stream.seek(0)
     478        return self.stream.read()
     479
     480    def teardown_logging(self):
     481        # remove the log handler for fake mailer output
     482        logger = logging.getLogger('test.smtp')
     483        handlers = [x for x in logger.handlers]
     484        for handler in handlers:
     485            logger.removeHandler(handler)
     486        return
     487
    454488    def test_student_properties(self):
    455489        self.student['studycourse'].current_level = 100
     
    607641        self.browser.getControl("Send message now").click()
    608642        self.assertTrue('Your message has been sent' in self.browser.contents)
     643        self.assertMatches(
     644            'Sending email from no-reply@waeup.org to xx@yy.zz:'
     645            '\nMessage:'
     646            '\nmsg: MIME-Version: 1.0'
     647            '\nmsg: Content-Type: text/plain; charset="us-ascii"'
     648            '\nmsg: Content-Transfer-Encoding: 7bit'
     649            '\nmsg: From: Manager <no-reply@waeup.org>'
     650            '\nmsg: To: Anna Tester <xx@yy.zz>'
     651            '\nmsg: Reply-To: Manager <contact@waeup.org>'
     652            '\nmsg: Subject: Important subject'
     653            '\nmsg:'
     654            '\nmsg: Hello!'
     655            '\nmsg:'
     656            '\nmsg: ---'
     657            '\nmsg: Manager (id: zope.mgr)'
     658            '\nmsg: Sample University'
     659            '\nmsg:',
     660            self.get_fake_smtp_output()
     661            )
    609662        return
    610663
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py

    r15964 r16213  
    251251        """
    252252        config = grok.getSite()['configuration']
    253         text = _(u"""Fullname: ${a}
    254 User Id: ${b}
    255 User Type: ${c}
    256 Portal: ${d}
    257 
    258 ${e}
     253        text = _(u"""${e}
     254
     255---
     256${a} (id: ${b})
     257${d}
    259258""")
    260259        text = _(text, mapping={
Note: See TracChangeset for help on using the changeset viewer.