Ignore:
Timestamp:
12 Jul 2015, 17:19:11 (9 years ago)
Author:
Henrik Bettermann
Message:

Comments with correct punctuation.

File:
1 edited

Legend:

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

    r13108 r13164  
    14791479        self.init_clearance_officer()
    14801480        self.assertMatches('...You logged in...', self.browser.contents)
    1481         # CO is landing on index page
     1481        # CO is landing on index page.
    14821482        self.assertEqual(self.browser.url, 'http://localhost/app/index')
    14831483        # CO can see his roles
     
    14891489        self.assertFalse('Clearance Officer' in self.browser.contents)
    14901490        # ... because we forgot to notify the department that the local role
    1491         # has changed
     1491        # has changed.
    14921492        notify(LocalRoleSetEvent(
    14931493            self.department, 'waeup.local.ClearanceOfficer', 'mrclear',
     
    15021502        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    15031503        self.assertEqual(self.browser.url, self.clearance_path)
    1504         # ... but not other students
     1504        # ... but not other students.
    15051505        self.assertRaises(
    15061506            Unauthorized, self.browser.open, self.other_student_path)
    1507         # Clearance is disabled for this session
     1507        # Clearance is disabled for this session.
    15081508        self.browser.open(self.clearance_path)
    15091509        self.assertFalse('Clear student' in self.browser.contents)
     
    15121512            in self.browser.contents)
    15131513        self.app['configuration']['2004'].clearance_enabled = True
    1514         # Only in state clearance requested the CO does see the 'Clear' button
     1514        # Only in state clearance requested the CO does see the 'Clear' button.
    15151515        self.browser.open(self.clearance_path)
    15161516        self.assertFalse('Clear student' in self.browser.contents)
     
    15321532        self.assertEqual(
    15331533            self.browser.url, self.student_path + '/reject_clearance')
    1534         # Type comment why
     1534        # Type comment why.
    15351535        self.browser.getControl(name="form.officer_comment").value = (
    15361536            'Dear Student,\n'
     
    15411541              'contactstudent?body=Dear+Student%2C%0AYou+did+not+fill+properly.'
    15421542              '&subject=Clearance+has+been+annulled.')
    1543         # CO does now see the prefilled contact form and can send a message
     1543        # CO does now see the prefilled contact form and can send a message.
    15441544        self.assertEqual(self.browser.url, url)
    15451545        self.assertTrue('clearance started' in self.browser.contents)
     
    15541554        self.assertEqual(self.student.officer_comment,
    15551555            u'Dear Student,\nYou did not fill properly.')
    1556         # ... and logged
     1556        # ... and logged.
    15571557        logfile = os.path.join(
    15581558            self.app['datacenter'].storage, 'logs', 'students.log')
     
    15731573        self.assertTrue('clearance started' in self.browser.contents)
    15741574        # The CO can't clear students if not in state
    1575         # clearance requested
     1575        # clearance requested.
    15761576        self.browser.open(self.student_path + '/clear')
    15771577        self.assertTrue('Student is in wrong state'
     
    15801580        self.browser.open('http://localhost/app/users/mrclear/my_roles')
    15811581        self.browser.getLink("http://localhost/app/faculties/fac1/dep1").click()
    1582         # ... and view the list of students
     1582        # ... and view the list of students.
    15831583        self.browser.getLink("Show students").click()
    15841584        self.browser.getControl(name="session").value = ['2004']
     
    15901590        self.browser.getControl("Show").click()
    15911591        self.assertTrue(self.student_id in self.browser.contents)
    1592         # The comment is indicated by 'yes'
     1592        # The comment is indicated by 'yes'.
    15931593        self.assertTrue('<td><span>yes</span></td>' in self.browser.contents)
    15941594        # Check if the enquiries form is not pre-filled with officer_comment
    1595         # (regression test)
     1595        # (regression test).
    15961596        self.browser.getLink("Logout").click()
    15971597        self.browser.open('http://localhost/app/enquiries')
     
    16401640        prmlocal.assignRoleToPrincipal('waeup.local.CourseAdviser100', 'mrsadvise')
    16411641        IWorkflowState(self.student).setState('school fee paid')
    1642         # Login as course adviser
     1642        # Login as course adviser.
    16431643        self.browser.open(self.login_path)
    16441644        self.browser.getControl(name="form.login").value = 'mrsadvise'
     
    16461646        self.browser.getControl("Login").click()
    16471647        self.assertMatches('...You logged in...', self.browser.contents)
    1648         # CO can see his roles
     1648        # CO can see his roles.
    16491649        self.browser.getLink("My Roles").click()
    16501650        self.assertMatches(
     
    16541654        self.assertFalse('Course Adviser' in self.browser.contents)
    16551655        # ... because we forgot to notify the certificate that the local role
    1656         # has changed
     1656        # has changed.
    16571657        notify(LocalRoleSetEvent(
    16581658            cert, 'waeup.local.CourseAdviser100', 'mrsadvise', granted=True))
     
    16661666        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    16671667        self.assertEqual(self.browser.url, self.student_path)
    1668         # ... but not other students
     1668        # ... but not other students.
    16691669        other_student = Student()
    16701670        other_student.firstname = u'Dep2'
     
    16751675        self.assertRaises(
    16761676            Unauthorized, self.browser.open, other_student_path)
    1677         # We add study level 110 to the student's studycourse
     1677        # We add study level 110 to the student's studycourse.
    16781678        studylevel = StudentStudyLevel()
    16791679        studylevel.level = 110
     
    16811681            cert,studylevel)
    16821682        L110_student_path = self.studycourse_path + '/110'
    1683         # The CA can neither see the Validate nor the Edit button
     1683        # The CA can neither see the Validate nor the Edit button.
    16841684        self.browser.open(L110_student_path)
    16851685        self.assertFalse('Validate courses' in self.browser.contents)
     
    16921692        # corresponds with the name of the study level object
    16931693        # the 100L CA does see the 'Validate' button but not
    1694         # the edit button
     1694        # the edit button.
    16951695        self.student['studycourse'].current_level = 110
    16961696        self.browser.open(L110_student_path)
    16971697        self.assertFalse('Edit' in self.browser.contents)
    16981698        self.assertTrue('Validate courses' in self.browser.contents)
    1699         # But a 100L CA does not see the button at other levels
     1699        # But a 100L CA does not see the button at other levels.
    17001700        studylevel2 = StudentStudyLevel()
    17011701        studylevel2.level = 200
     
    17311731            in self.browser.contents)
    17321732        self.assertTrue('school fee paid' in self.browser.contents)
    1733         # CA does now see the contact form and can send a message
     1733        # CA does now see the contact form and can send a message.
    17341734        self.browser.getControl(name="form.subject").value = 'Important subject'
    17351735        self.browser.getControl(name="form.body").value = 'Course list rejected'
     
    17371737        self.assertTrue('Your message has been sent' in self.browser.contents)
    17381738        # The CA does now see the Edit button and can edit
    1739         # current study level
     1739        # current study level.
    17401740        self.browser.open(L110_student_path)
    17411741        self.browser.getLink("Edit").click()
     
    17431743            in self.browser.contents)
    17441744        # The CA can't validate courses if not in state
    1745         # courses registered
     1745        # courses registered.
    17461746        self.browser.open(L110_student_path + '/validate_courses')
    17471747        self.assertTrue('Student is in the wrong state'
    17481748            in self.browser.contents)
    1749         # The CA can go to his certificate through the my_roles page
     1749        # The CA can go to his certificate through the my_roles page ...
    17501750        self.browser.open('http://localhost/app/users/mrsadvise/my_roles')
    17511751        self.browser.getLink(
    17521752            "http://localhost/app/faculties/fac1/dep1/certificates/CERT1").click()
    1753         # and view the list of students
     1753        # ... and view the list of students.
    17541754        self.browser.getLink("Show students").click()
    17551755        self.browser.getControl(name="session").value = ['2004']
     
    17621762        self.app['users']['mrslecturer'].email = 'mrslecturer@foo.ng'
    17631763        self.app['users']['mrslecturer'].title = u'Mercedes Benz'
    1764         # Assign local Lecturer role for a certificate
     1764        # Assign local Lecturer role for a certificate.
    17651765        course = self.app['faculties']['fac1']['dep1'].courses['COURSE1']
    17661766        prmlocal = IPrincipalRoleManager(course)
    17671767        prmlocal.assignRoleToPrincipal('waeup.local.Lecturer', 'mrslecturer')
    1768         # Login as lecturer
     1768        # Login as lecturer.
    17691769        self.browser.open(self.login_path)
    17701770        self.browser.getControl(name="form.login").value = 'mrslecturer'
     
    17721772        self.browser.getControl("Login").click()
    17731773        self.assertMatches('...You logged in...', self.browser.contents)
    1774         # CO can see her roles
     1774        # CO can see her roles.
    17751775        self.browser.getLink("My Roles").click()
    17761776        self.assertMatches(
     
    17801780        self.assertFalse('Lecturer' in self.browser.contents)
    17811781        # ... because we forgot to notify the course that the local role
    1782         # has changed
     1782        # has changed.
    17831783        notify(LocalRoleSetEvent(
    17841784            course, 'waeup.local.Lecturer', 'mrslecturer', granted=True))
     
    17881788            '...<a href="http://localhost/app/faculties/fac1/dep1/courses/COURSE1">...',
    17891789            self.browser.contents)
    1790         # The lecturer can go to her course
     1790        # The lecturer can go to her course ...
    17911791        self.browser.getLink(
    17921792            "http://localhost/app/faculties/fac1/dep1/courses/COURSE1").click()
    1793         # and view the list of students
     1793        # ... and view the list of students
    17941794        self.browser.getLink("Show students").click()
    17951795        self.browser.getControl(name="session").value = ['2004']
     
    17971797        self.browser.getControl("Show").click()
    17981798        self.assertTrue('No student found.' in self.browser.contents)
    1799         # No student in course so far
     1799        # No student in course so far.
    18001800        self.assertFalse(self.student_id in self.browser.contents)
    18011801        studylevel = createObject(u'waeup.StudentStudyLevel')
     
    18201820        self.assertRaises(
    18211821            Unauthorized, self.browser.open, course_ticket_path)
    1822         # Course results can be batch edited via the edit_courses view
     1822        # Course results can be batch edited via the edit_courses view.
    18231823        self.app['faculties']['fac1']['dep1'].score_editing_disabled = True
    18241824        self.browser.open("http://localhost/app/faculties/fac1/dep1/courses/COURSE1")
     
    18341834            in self.browser.contents)
    18351835        IWorkflowState(self.student).setState('courses validated')
    1836         # Student must be in state 'courses validated'
     1836        # Student must be in state 'courses validated'.
    18371837        self.browser.open(
    18381838            "http://localhost/app/faculties/fac1/dep1/courses/COURSE1/edit_scores")
     
    18421842        self.browser.getControl(name="scores", index=0).value = '55'
    18431843        self.browser.getControl("Update scores").click()
    1844         # New score has been set
     1844        # New score has been set.
    18451845        self.assertEqual(
    18461846            self.student['studycourse']['100']['COURSE1'].score, 55)
    1847         # Score editing has been logged
     1847        # Score editing has been logged.
    18481848        logfile = os.path.join(
    18491849            self.app['datacenter'].storage, 'logs', 'students.log')
     
    18511851        self.assertTrue('mrslecturer - students.browser.EditScoresPage - '
    18521852                        'K1000000 100/COURSE1 score updated (55)' in logcontent)
    1853         # Non-integer scores won't be accepted
     1853        # Non-integer scores won't be accepted.
    18541854        self.browser.open(
    18551855            "http://localhost/app/faculties/fac1/dep1/courses/COURSE1/edit_scores")
     
    18591859        self.assertTrue('Error: Score(s) of Anna Tester have not be updated'
    18601860            in self.browser.contents)
    1861         # Scores can be removed
     1861        # Scores can be removed.
    18621862        self.browser.open(
    18631863            "http://localhost/app/faculties/fac1/dep1/courses/COURSE1/edit_scores")
     
    29852985        self.browser.getControl("Login").click()
    29862986        # Students can add online booking fee payment tickets and open the
    2987         # callback view (see test_manage_payments)
     2987        # callback view (see test_manage_payments).
    29882988        self.browser.getLink("Payments").click()
    29892989        self.browser.getLink("Add current session payment ticket").click()
     
    29942994        self.browser.getLink(value).click()
    29952995        self.browser.open(self.browser.url + '/fake_approve')
    2996         # The new HOS-0 pin has been created
     2996        # The new HOS-0 pin has been created.
    29972997        self.assertEqual(len(self.app['accesscodes']['HOS-0']),1)
    29982998        pin = self.app['accesscodes']['HOS-0'].keys()[0]
     
    30293029        self.assertMatches('...You are not the owner of this access code...',
    30303030                           self.browser.contents)
    3031         # The bed remains empty
     3031        # The bed remains empty.
    30323032        bed = self.app['hostels']['hall-1']['hall-1_A_101_A']
    30333033        self.assertTrue(bed.owner == NOT_OCCUPIED)
     
    30383038        self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
    30393039                           self.browser.contents)
    3040         # Bed has been allocated
     3040        # Bed has been allocated.
    30413041        self.assertTrue(bed.owner == self.student_id)
    3042         # BedTicketAddPage is now blocked
     3042        # BedTicketAddPage is now blocked.
    30433043        self.browser.getLink("Book accommodation").click()
    30443044        self.assertMatches('...You already booked a bed space...',
    30453045            self.browser.contents)
    3046         # The bed ticket displays the data correctly
     3046        # The bed ticket displays the data correctly.
    30473047        self.browser.open(self.acco_path + '/2004')
    30483048        self.assertMatches('...Hall 1, Block A, Room 101, Bed A...',
     
    30513051        self.assertMatches('...regular_male_fr...', self.browser.contents)
    30523052        self.assertMatches('...%s...' % pin, self.browser.contents)
    3053         # Students can open the pdf slip
     3053        # Students can open the pdf slip.
    30543054        self.browser.open(self.browser.url + '/bed_allocation_slip.pdf')
    30553055        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    30563056        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
    3057         # Students can't relocate themselves
     3057        # Students can't relocate themselves.
    30583058        self.assertFalse('Relocate' in self.browser.contents)
    30593059        relocate_path = self.acco_path + '/2004/relocate'
    30603060        self.assertRaises(
    30613061            Unauthorized, self.browser.open, relocate_path)
    3062         # Students can't the Remove button and check boxes
     3062        # Students can't see the Remove button and check boxes.
    30633063        self.browser.open(self.acco_path)
    30643064        self.assertFalse('Remove' in self.browser.contents)
    30653065        self.assertFalse('val_id' in self.browser.contents)
    3066         # Students can pay maintenance fee now
     3066        # Students can pay maintenance fee now.
    30673067        self.browser.open(self.payments_path)
    30683068        self.browser.open(self.payments_path + '/addop')
     
    30733073        ctrl = self.browser.getControl(name='val_id')
    30743074        value = ctrl.options[0]
    3075         # Maintennace fee is taken from the hostel object
     3075        # Maintennace fee is taken from the hostel object.
    30763076        self.assertEqual(self.student['payments'][value].amount_auth, 876.0)
    30773077        # If the hostel's maintenance fee isn't set, the fee is
Note: See TracChangeset for help on using the changeset viewer.