Changeset 9531 for main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Timestamp:
- 4 Nov 2012, 21:51:57 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/applicants
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r9529 r9531 397 397 @action(_('Save'), style='primary') 398 398 def save(self, **data): 399 self.applyData(self.context, **data) 399 changed_fields = self.applyData(self.context, **data) 400 if changed_fields: 401 changed_fields = reduce(lambda x,y: x+y, changed_fields.values()) 402 else: 403 changed_fields = [] 400 404 self.context.description_dict = self._description() 401 405 # Always refresh title. So we can change titles … … 406 410 title, self.context.year, self.context.year + 1) 407 411 self.flash(_('Form has been saved.')) 412 fields_string = ' + '.join(changed_fields) 413 self.context.writeLogMessage(self, 'saved: % s' % fields_string) 408 414 return 409 415 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/container.py
r8993 r9531 113 113 return False 114 114 115 def writeLogMessage(self, view, message): 116 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 117 self.__parent__.logger.info( 118 '%s - %s - %s' % (ob_class, self.code, message)) 119 return 115 120 116 121 ApplicantsContainer = attrs_to_fields(ApplicantsContainer) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r9217 r9531 290 290 """ 291 291 292 def writeLogMessage(view, comment): 293 """Adds an INFO message to the log file 294 """ 295 292 296 class IApplicantsContainerAdd(IApplicantsContainer): 293 297 """An applicants container contains university applicants. -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r9398 r9531 19 19 Test the applicant-related UI components. 20 20 """ 21 import os 21 22 import pytz 22 23 import shutil … … 370 371 self.assertEqual(self.browser.headers['Status'], '200 Ok') 371 372 self.assertEqual(self.browser.url, self.manage_container_path) 373 self.browser.getControl(name="form.application_fee").value = '200' 372 374 self.browser.getControl("Save").click() 373 375 self.assertTrue('Form has been saved' in self.browser.contents) 376 logfile = os.path.join( 377 self.app['datacenter'].storage, 'logs', 'applicants.log') 378 logcontent = open(logfile).read() 379 self.assertTrue( 380 'zope.mgr - applicants.browser.ApplicantsContainerManageFormPage - ' 381 'app2010 - saved: application_fee\n' in logcontent) 374 382 self.browser.getControl("Remove selected", index=0).click() 375 383 self.assertTrue('No applicant selected' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.