Ignore:
Timestamp:
18 Nov 2011, 08:48:22 (13 years ago)
Author:
Henrik Bettermann
Message:

Add fields email and phone which can be edited via the StudentBaseEditFormPage?. email, phone and passport picture are required for starting clearance.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/sample_student_data.csv

    r6844 r7133  
    1 firstname,lastname,fullname,reg_number,date_of_birth,matric_number
    2 Aaren,Pieri,Aaren Pieri,1,1990-01-02,100000
    3 Aaren,Finau,Aaren Finau,2,1990-01-03,100001
    4 Aaren,Berson,Aaren Berson,3,1990-01-04,100002
     1firstname,lastname,fullname,reg_number,date_of_birth,matric_number,email,phone
     2Aaren,Pieri,Aaren Pieri,1,1990-01-02,100000,aa@aa.ng,1234
     3Aaren,Finau,Aaren Finau,2,1990-01-03,100001,aa@aa.ng,1234
     4Aaren,Berson,Aaren Berson,3,1990-01-04,100002,aa@aa.ng,1234
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7127 r7133  
    9191        student.matric_number = u'234'
    9292        student.sex = u'm'
     93        student.email = 'aa@aa.ng'
     94        student.phone = 1234
    9395        self.app['students'].addStudent(student)
    9496        self.student_id = student.student_id
     
    104106        self.add_student_path = self.container_path + '/addstudent'
    105107        self.student_path = self.container_path + '/' + self.student_id
    106         self.manage_student_path = self.student_path + '/edit_base'
     108        self.manage_student_path = self.student_path + '/manage_base'
    107109        self.clearance_student_path = self.student_path + '/view_clearance'
    108110        self.personal_student_path = self.student_path + '/view_personal'
     
    584586        # Prepare a csv file for students
    585587        open('students.csv', 'wb').write(
    586 """firstname,lastname,fullname,reg_number,date_of_birth,matric_number
    587 Aaren,Pieri,Aaren Pieri,1,1990-01-02,100000
    588 Claus,Finau,Claus Finau,2,1990-01-03,100001
    589 Brit,Berson,Brit Berson,3,1990-01-04,100001
     588"""firstname,lastname,fullname,reg_number,date_of_birth,matric_number,email,phone
     589Aaren,Pieri,Aaren Pieri,1,1990-01-02,100000,aa@aa.ng,1234
     590Claus,Finau,Claus Finau,2,1990-01-03,100001,aa@aa.ng,1234
     591Brit,Berson,Brit Berson,3,1990-01-04,100001,aa@aa.ng,1234
    590592""")
    591593        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     
    757759        self.browser.getLink("Clearance Data").click()
    758760        self.browser.getLink("Start clearance").click()
     761        self.student.email = None
     762        # Uups, we forgot to fill the email fields
     763        self.browser.getControl("Start clearance").click()
     764        self.assertMatches('...Not all required fields filled...',
     765                           self.browser.contents)
     766        self.student.email = 'aa@aa.ng'
     767        self.browser.open(self.student_path + '/start_clearance')
    759768        self.browser.getControl(name="ac_series").value = '3'
    760769        self.browser.getControl(name="ac_number").value = '4444444'
     
    923932        ac = self.app['accesscodes']['CLR-0'][pin]
    924933        ac.owner = self.student_id
    925         # The new CLR-0 pin can be used for starting clearance
    926         IWorkflowInfo(self.student).fireTransition('admit')
    927         self.browser.open(self.student_path + '/start_clearance')
    928         parts = pin.split('-')[1:]
    929         clrseries, clrnumber = parts
    930         self.browser.getControl(name="ac_series").value = clrseries
    931         self.browser.getControl(name="ac_number").value = clrnumber
    932         self.browser.getControl("Start clearance now").click()
    933         self.assertMatches('...Clearance process has been started...',
    934                            self.browser.contents)
    935934        return
    936935
     
    975974
    976975        # The new CLR-0 pin can be used for starting clearance
     976        # but they have to upload a passport picture first
     977        # which is only possible in state admitted
     978        self.browser.open(self.student_path + '/change_portrait')
     979        self.assertMatches('...form is locked...',
     980                          self.browser.contents)
    977981        IWorkflowInfo(self.student).fireTransition('admit')
     982        self.browser.open(self.student_path + '/change_portrait')
     983        pseudo_image = StringIO('I pretend to be a graphics file')
     984        ctrl = self.browser.getControl(name='passportuploadedit')
     985        file_ctrl = ctrl.mech_control
     986        file_ctrl.add_file(pseudo_image, filename='my_photo.jpg')
     987        self.browser.getControl(
     988            name='upload_passportuploadedit').click()
    978989        self.browser.open(self.student_path + '/start_clearance')
    979990        parts = pin.split('-')[1:]
Note: See TracChangeset for help on using the changeset viewer.