Ignore:
Timestamp:
23 Sep 2020, 19:42:07 (4 years ago)
Author:
Henrik Bettermann
Message:

Save email address provided by mandate when referee report
is created. Add RefereeReportManageFormPage (no button available).

File:
1 edited

Legend:

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

    r16231 r16243  
    2525import grok
    2626import logging
    27 from datetime import datetime
    2827from StringIO import StringIO
    2928from datetime import datetime, date, timedelta
     
    18051804        return
    18061805
    1807     def test_add_and_view_reports(self):
     1806    def test_add_and_view_manage_reports(self):
    18081807        mandate = RefereeReportMandate()
    18091808        mandate.params['name'] = u'John Referee'
     
    18441843        self.assertEqual(len(self.applicant.refereereports), 1)
    18451844        report = self.applicant.refereereports[0]
     1845        # The email address has been stored
     1846        self.assertEqual(report.email, 'aa@aa.aa')
    18461847        # Referee can use mandate again to download the pdf report
    18471848        self.browser.open('http://localhost/app/mandate?mandate_id=%s'
     
    18751876        self.assertEqual(self.browser.headers['Content-Type'],
    18761877                         'application/pdf')
    1877         path = os.path.join(samples_dir(), 'referee_report_slip.pdf')
    1878         open(path, 'wb').write(self.browser.contents)
    1879         print "Sample PDF referee_report_slip.pdf written to %s" % path
    18801878        # Mandate is not deleted ...
    18811879        self.assertEqual(len(self.app['mandates'].keys()), 2)
     
    18881886            self.app['mandates'][mandate.mandate_id].params['redirect_path2'],
    18891887            redirect_path2)
     1888        # Portal managers can edit referee reports (no button available!)
     1889        self.browser.open(self.view_path + '/%s/manage' % report.r_id)
     1890        self.browser.getControl(name="form.email_pref").value = 'bb@bb.de'
     1891        self.browser.getControl("Save").click()
     1892        self.assertEqual(report.email_pref, 'bb@bb.de')
    18901893        # Managers can delete referee reports
    18911894        self.browser.open(self.manage_path)
     
    18961899        self.assertTrue('Referee report removed.' in self.browser.contents)
    18971900        self.assertEqual(self.browser.url, self.view_path)
    1898         # Report creation and deletion is logged
     1901        # Report creation, managing and deletion is logged
    18991902        logfile = os.path.join(
    19001903            self.app['datacenter'].storage, 'logs', 'applicants.log')
     
    19041907            '%s - added: %s\n' % (self.applicant.applicant_id, report.r_id)
    19051908            in logcontent)
     1909        self.assertTrue(
     1910            'zope.mgr - applicants.browser.RefereeReportManageFormPage - '
     1911            '%s - %s - saved: email_pref\n' % (
     1912            self.applicant.applicant_id, report.r_id) in logcontent)
    19061913        self.assertTrue(
    19071914            'zope.mgr - applicants.browser.RemoveRefereeReportPage - '
Note: See TracChangeset for help on using the changeset viewer.