Changeset 14016 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 7 Jul 2016, 06:18:06 (8 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r14014 r14016 1176 1176 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 1177 1177 failed = '' 1178 emails_sent = 0 1178 1179 for referee in self.context.referees: 1179 1180 if referee.email_sent: … … 1193 1194 success = kofa_utils.inviteReferee(referee, self.context, url_info) 1194 1195 if success: 1196 emails_sent += 1 1195 1197 self.context.writeLogMessage( 1196 1198 self, 'email sent: %s' % referee.email) … … 1198 1200 else: 1199 1201 failed += '%s ' % referee.email 1200 return failed 1202 return failed, emails_sent 1201 1203 1202 1204 @action(_('Finally Submit'), warning=WARNING) … … 1218 1220 # Create mandates and send emails to referees 1219 1221 if getattr(self.context, 'referees', None): 1220 failed = self.informReferees()1222 failed, emails_sent = self.informReferees() 1221 1223 if failed: 1222 1224 self.flash( … … 1225 1227 return 1226 1228 msg = _('Form has been successfully submitted and ' 1227 'all invitation emails were sent.') 1229 '${a} invitation emails were sent.', 1230 mapping = {'a': emails_sent}) 1228 1231 IWorkflowInfo(self.context).fireTransition('submit') 1229 1232 # application_date is used in export files for sorting. -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r14014 r14016 1677 1677 self.assertTrue( 1678 1678 'Application submitted' in self.browser.contents) 1679 self.assertTrue( 1680 'Form has been successfully submitted and 2 ' 1681 'invitation emails were sent.' in self.browser.contents) 1679 1682 logfile = os.path.join( 1680 1683 self.app['datacenter'].storage, 'logs', 'applicants.log') … … 1687 1690 self.assertTrue(referee1.email_sent) 1688 1691 self.assertTrue(referee2.email_sent) 1689 return 1692 # If the form is being resubmitted, no more emails will be sent 1693 IWorkflowState(self.applicant).setState('paid') 1694 self.applicant.locked = False 1695 self.browser.open(self.edit_path) 1696 self.browser.getControl(name="confirm_passport").value = True 1697 self.browser.getControl("Finally Submit").click() 1698 self.assertTrue( 1699 'Form has been successfully submitted and 0 ' 1700 'invitation emails were sent.' in self.browser.contents) 1701 return -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_smtp.py
r11778 r14016 61 61 myself = __file__ 62 62 if myself.endswith('.pyc'): 63 myself = myself[:- 2]63 myself = myself[:-1] 64 64 print "WARNING: external mail tests are skipped!" 65 65 print "WARNING: edit %s to enable them." % myself
Note: See TracChangeset for help on using the changeset viewer.