Ignore:
Timestamp:
15 Jun 2015, 08:57:24 (9 years ago)
Author:
Henrik Bettermann
Message:

More docs.

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

    r13040 r13047  
    20522052                self.flash(_('System error: Please contact the adminsitrator.'),
    20532053                           type="danger")
    2054                 self.context.writeLogMessage(self, 'fatal error: %s' % bed.bed_id)
     2054                self.context.writeLogMessage(
     2055                    self, 'fatal error: %s' % bed.bed_id)
    20552056                return
    20562057        else:
     
    20632064                students_utils = getUtility(IStudentsUtils)
    20642065                bed = students_utils.selectBed(available_beds)
    2065                 # Safety belt for paranoids: Does this bed really exist in portal?
     2066                # Safety belt for paranoids: Does this bed really exist
     2067                # in portal?
    20662068                # XXX: Can be remove if nobody complains.
    20672069                if bed.__parent__.__parent__ is None:
    2068                     self.flash(_('System error: Please contact the adminsitrator.'),
    2069                                type="warning")
    2070                     self.context.writeLogMessage(self, 'fatal error: %s' % bed.bed_id)
     2070                    self.flash(_(
     2071                        'System error: Please contact the adminsitrator.'),
     2072                        type="warning")
     2073                    self.context.writeLogMessage(
     2074                        self, 'fatal error: %s' % bed.bed_id)
    20712075                    return
    20722076                bed.bookBed(student.student_id)
     
    22192223            self.context.bed.owner = NOT_OCCUPIED
    22202224            notify(grok.ObjectModifiedEvent(self.context.bed))
    2221         # Alocate new bed
     2225        # Designate new bed in ticket
    22222226        self.context.bed_type = acc_details['bt']
    22232227        self.context.bed = new_bed
     
    27882792
    27892793class StudentRequestPasswordPage(KofaAddFormPage):
    2790     """Captcha'd registration page for applicants.
     2794    """Captcha'd request password page for students.
    27912795    """
    27922796    grok.name('requestpw')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r13046 r13047  
    14761476            '...<div>Academics Officer (view only)</div>...',
    14771477            self.browser.contents)
    1478         #self.assertMatches(
    1479         #    '...<div>Students Officer (view only)</div>...',
    1480         #    self.browser.contents)
    14811478        # But not his local role ...
    14821479        self.assertFalse('Clearance Officer' in self.browser.contents)
     
    14841481        # has changed
    14851482        notify(LocalRoleSetEvent(
    1486             self.department, 'waeup.local.ClearanceOfficer', 'mrclear', granted=True))
     1483            self.department, 'waeup.local.ClearanceOfficer', 'mrclear',
     1484            granted=True))
    14871485        self.browser.open('http://localhost/app/users/mrclear/my_roles')
    14881486        self.assertTrue('Clearance Officer' in self.browser.contents)
     
    15251523            self.browser.url, self.student_path + '/reject_clearance')
    15261524        # Type comment why
    1527         self.browser.getControl(name="form.officer_comment").value = """Dear Student,
    1528 You did not fill properly.
    1529 """
     1525        self.browser.getControl(name="form.officer_comment").value = (
     1526            'Dear Student,\n'
     1527            'You did not fill properly.')
    15301528        self.browser.getControl("Save comment").click()
    15311529        self.assertTrue('Clearance has been annulled' in self.browser.contents)
    15321530        url = ('http://localhost/app/students/K1000000/'
    15331531              'contactstudent?body=Dear+Student%2C%0AYou+did+not+fill+properly.'
    1534               '%0A&subject=Clearance+has+been+annulled.')
     1532              '&subject=Clearance+has+been+annulled.')
    15351533        # CO does now see the prefilled contact form and can send a message
    15361534        self.assertEqual(self.browser.url, url)
     
    15451543        # The comment has been stored ...
    15461544        self.assertEqual(self.student.officer_comment,
    1547             u'Dear Student,\nYou did not fill properly.\n')
     1545            u'Dear Student,\nYou did not fill properly.')
    15481546        # ... and logged
    15491547        logfile = os.path.join(
     
    15531551            'INFO - mrclear - students.browser.StudentRejectClearancePage - '
    15541552            'K1000000 - comment: Dear Student,<br>You did not fill '
    1555             'properly.<br>\n' in logcontent)
     1553            'properly.\n' in logcontent)
    15561554        self.browser.open(self.history_path)
    15571555        self.assertTrue("Reset to 'clearance started' by My Public Name" in
     
    16011599        # Additional setups according to test above
    16021600        notify(LocalRoleSetEvent(
    1603             self.department, 'waeup.local.ClearanceOfficer', 'mrclear', granted=True))
     1601            self.department, 'waeup.local.ClearanceOfficer', 'mrclear',
     1602            granted=True))
    16041603        self.app['configuration']['2004'].clearance_enabled = True
    16051604        IWorkflowState(self.student).setState('clearance requested')
     
    29712970
    29722971    def test_student_accommodation(self):
    2973         # Login
    29742972        self.browser.open(self.login_path)
    29752973        self.browser.getControl(name="form.login").value = self.student_id
    29762974        self.browser.getControl(name="form.password").value = 'spwd'
    29772975        self.browser.getControl("Login").click()
    2978 
    29792976        # Students can add online booking fee payment tickets and open the
    29802977        # callback view (see test_manage_payments)
     
    29932990        parts = pin.split('-')[1:]
    29942991        sfeseries, sfenumber = parts
    2995 
    29962992        # Students can use HOS code and book a bed space with it ...
    29972993        self.browser.open(self.acco_path)
     
    30293025        self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
    30303026                           self.browser.contents)
    3031 
    30323027        # Bed has been allocated
    30333028        bed = self.app['hostels']['hall-1']['hall-1_A_101_A']
    30343029        self.assertTrue(bed.owner == self.student_id)
    3035 
    30363030        # BedTicketAddPage is now blocked
    30373031        self.browser.getLink("Book accommodation").click()
    30383032        self.assertMatches('...You already booked a bed space...',
    30393033            self.browser.contents)
    3040 
    30413034        # The bed ticket displays the data correctly
    30423035        self.browser.open(self.acco_path + '/2004')
     
    30463039        self.assertMatches('...regular_male_fr...', self.browser.contents)
    30473040        self.assertMatches('...%s...' % pin, self.browser.contents)
    3048 
    30493041        # Students can open the pdf slip
    30503042        self.browser.open(self.browser.url + '/bed_allocation_slip.pdf')
    30513043        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    30523044        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
    3053 
    30543045        # Students can't relocate themselves
    30553046        self.assertFalse('Relocate' in self.browser.contents)
     
    30573048        self.assertRaises(
    30583049            Unauthorized, self.browser.open, relocate_path)
    3059 
    30603050        # Students can't the Remove button and check boxes
    30613051        self.browser.open(self.acco_path)
    30623052        self.assertFalse('Remove' in self.browser.contents)
    30633053        self.assertFalse('val_id' in self.browser.contents)
    3064 
    30653054        # Students can pay maintenance fee now
    30663055        self.browser.open(self.payments_path)
     
    30703059        self.assertMatches('...Payment ticket created...',
    30713060                           self.browser.contents)
    3072 
    30733061        ctrl = self.browser.getControl(name='val_id')
    30743062        value = ctrl.options[0]
Note: See TracChangeset for help on using the changeset viewer.