Changeset 9332 for main/waeup.kofa


Ignore:
Timestamp:
12 Oct 2012, 16:40:52 (12 years ago)
Author:
Henrik Bettermann
Message:

Log the removal of study levels or course tickets.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r9330 r9332  
    855855            self.flash(_('Successfully removed: ${a}',
    856856                mapping = {'a':', '.join(deleted)}))
     857            self.context.writeLogMessage(
     858                self,'removed: %s' % ', '.join(deleted))
    857859        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
    858860        return
     
    10531055            self.flash(_('Successfully removed: ${a}',
    10541056                mapping = {'a':', '.join(deleted)}))
     1057            self.context.writeLogMessage(
     1058                self,'removed: %s' % ', '.join(deleted))
    10551059        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
    10561060        return
     
    20742078            self.flash(_('Successfully removed: ${a}',
    20752079                mapping = {'a':', '.join(deleted)}))
     2080            self.context.writeLogMessage(
     2081                self,'removed: %s' % ', '.join(deleted))
    20762082        self.redirect(self.url(self.context, u'@@edit'))
    20772083        return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9331 r9332  
    686686        self.browser.getControl("Remove selected").click()
    687687        self.assertMatches('...Successfully removed...', self.browser.contents)
     688        # Removing levels is properly logged
     689        logfile = os.path.join(
     690            self.app['datacenter'].storage, 'logs', 'students.log')
     691        logcontent = open(logfile).read()
     692        self.assertTrue('zope.mgr - students.browser.StudyCourseManageFormPage '
     693                        '- K1000000 - removed: 100' in logcontent)
    688694        # Add level again
    689695        self.browser.getControl(name="addlevel").value = ['100']
     
    703709        self.browser.getControl("Remove selected", index=0).click()
    704710        self.assertTrue('Successfully removed' in self.browser.contents)
     711        # Removing course tickets is properly logged
     712        logfile = os.path.join(
     713            self.app['datacenter'].storage, 'logs', 'students.log')
     714        logcontent = open(logfile).read()
     715        self.assertTrue('zope.mgr - students.browser.StudyLevelManageFormPage '
     716        '- K1000000 - removed: COURSE1' in logcontent)
    705717        self.browser.getControl("Add course ticket").click()
    706718        self.browser.getControl(name="form.course").value = ['COURSE1']
Note: See TracChangeset for help on using the changeset viewer.