Ignore:
Timestamp:
9 Feb 2018, 19:52:16 (7 years ago)
Author:
Henrik Bettermann
Message:

Do not log error messages.
Improve Student Creation Report.
Adjust tests.

File:
1 edited

Legend:

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

    r14949 r14952  
    161161        self.browser.open(self.container_path + '/createallstudents')
    162162        self.assertTrue('No record found' in self.browser.contents)
     163        self.assertFalse('Failed records' in self.browser.contents)
     164        self.assertFalse('Successfully created records' in self.browser.contents)
    163165        IWorkflowState(self.applicant).setState('admitted')
    164166        notify(grok.ObjectModifiedEvent(self.applicant))
    165167        self.browser.open(self.container_path + '/createallstudents')
    166168        self.assertTrue('No course admitted provided' in self.browser.contents)
    167         logcontent = open(logfile).read()
    168         self.assertTrue('No course admitted provided' in logcontent)
     169        self.assertFalse('Successfully created records' in self.browser.contents)
     170        self.assertTrue('Failed records' in self.browser.contents)
    169171        self.browser.open(self.manage_path)
    170172        self.browser.getControl(name="form.course_admitted").value = ['CERT1']
     
    174176        self.browser.open(self.container_path + '/createallstudents')
    175177        self.assertTrue('RequiredMissing: date_of_birth' in self.browser.contents)
    176         logcontent = open(logfile).read()
    177         self.assertTrue('RequiredMissing: date_of_birth' in logcontent)
     178        self.assertTrue('Failed records' in self.browser.contents)
     179        self.assertFalse('Successfully created records' in self.browser.contents)
    178180        self.browser.open(self.manage_path)
    179181        self.browser.getControl(name="form.date_of_birth").value = '09/09/1988'
    180182        self.browser.getControl("Save").click()
    181183        self.browser.open(self.container_path + '/createallstudents')
    182         self.assertTrue('1 students successfully created' in self.browser.contents)
     184        self.assertFalse('Failed records' in self.browser.contents)
     185        self.assertTrue('Successfully created records' in self.browser.contents)
    183186
    184187    def test_hidden_batch_copying_all(self):
     
    195198        self.browser.open(self.root_path + '/createallstudents')
    196199        self.assertTrue('No course admitted provided' in self.browser.contents)
    197         logcontent = open(logfile).read()
    198         self.assertTrue('No course admitted provided' in logcontent)
    199200        self.applicant.course_admitted = self.certificate
    200201        self.browser.open(self.root_path + '/createallstudents')
    201         self.assertTrue('1 students successfully created' in self.browser.contents)
     202        self.assertTrue('Successfully created records:' in self.browser.contents)
    202203
    203204    def test_copier_wo_passport(self):
     
    241242            'IOError: Application Slip could not be created.'
    242243            in self.browser.contents)
    243         logfile = os.path.join(
    244             self.app['datacenter'].storage, 'logs', 'applicants.log')
    245         logcontent = open(logfile).read()
    246         self.assertTrue(
    247             'IOError: Application Slip could not be created.' in logcontent)
    248244
    249245    def disabled_test_delay(self):
Note: See TracChangeset for help on using the changeset viewer.