Ignore:
Timestamp:
21 Jan 2012, 11:55:44 (13 years ago)
Author:
Henrik Bettermann
Message:

Import student password as well. This is crucial for upcoming portal migration.

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_migration.csv

    r7357 r7497  
    1 student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone
    2 A123456,Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234
    3 B123456,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234
    4 C123456,Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234
     1student_id,firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,password
     2A123456,Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234,mypw1
     3B123456,Aaren,Finau,2,1990-01-03,100001,aa@aa.ng,1234,mypw1
     4C123456,Aaren,Berson,3,1990-01-04,100002,aa@aa.ng,1234,mypw1
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_browser.py

    r7463 r7497  
    682682        # Prepare a csv file for students
    683683        open('students.csv', 'wb').write(
    684 """firstname,lastname,reg_number,date_of_birth,matric_number,email,phone
    685 Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234
    686 Claus,Finau,2,1990-01-03,100001,aa@aa.ng,1234
    687 Brit,Berson,3,1990-01-04,100001,aa@aa.ng,1234
     684"""firstname,lastname,reg_number,date_of_birth,matric_number,email,phone,password
     685Aaren,Pieri,1,1990-01-02,100000,aa@aa.ng,1234,mypwd1
     686Claus,Finau,2,1990-01-03,100001,aa@aa.ng,1234,mypwd1
     687Brit,Berson,3,1990-01-04,100001,aa@aa.ng,1234,mypwd1
    688688""")
    689689        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     
    739739        # The students are properly indexed and we can
    740740        # thus find a student in  the department
    741         self.browser.open(self.container_path)
     741        self.browser.open(self.manage_container_path)
    742742        self.browser.getControl(name="searchtype").value = ['depcode']
    743743        self.browser.getControl(name="searchterm").value = 'dep1'
    744744        self.browser.getControl("Search").click()
    745745        self.assertTrue('Aaren Pieri' in self.browser.contents)
     746        # We can search for a new student by name ...
     747        self.browser.getControl(name="searchtype").value = ['fullname']
     748        self.browser.getControl(name="searchterm").value = 'Claus'
     749        self.browser.getControl("Search").click()
     750        self.assertTrue('Claus Finau' in self.browser.contents)
     751        # ... and check if the imported password has been properly set
     752        ctrl = self.browser.getControl(name='entries')
     753        value = ctrl.options[0]
     754        claus = self.app['students'][value]
     755        self.assertTrue(IUserAccount(claus).checkPassword('mypwd1'))
    746756        return
    747757
Note: See TracChangeset for help on using the changeset viewer.