Changeset 8291


Ignore:
Timestamp:
27 Apr 2012, 05:28:01 (13 years ago)
Author:
Henrik Bettermann
Message:

Test password import.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_applicant_data.csv

    r8290 r8291  
    1 application_number,container_code,reg_number,firstname,lastname,date_of_birth,email,course1,sex,middlename
    2 1234,dp2011,1001,Aaren,Pieri,1990-01-02,xx@yy.zz,CERT1,m,Peter
    3 2345,dp2011,1002,Aaren,Finau,1990-01-03,xx@yy.zz,CERT1,m,Claus
    4 ,dp2011,1003,Aaren,Berson,1990-01-04,xx@yy.zz,CERT1,m,Alfons
     1application_number,container_code,reg_number,firstname,lastname,date_of_birth,email,course1,sex,middlename,password
     21234,dp2011,1001,Aaren,Pieri,1990-01-02,xx@yy.zz,CERT1,m,Peter,mypwd1
     32345,dp2011,1002,Aaren,Finau,1990-01-03,xx@yy.zz,CERT1,m,Claus,
     4,dp2011,1003,Aaren,Berson,1990-01-04,xx@yy.zz,CERT1,m,Alfons,
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_faulty_applicant_data.csv

    r8290 r8291  
    1 application_number,container_code,reg_number,firstname,lastname,date_of_birth,email,course1,sex,middlename
    2 ,dp2011,1001,Aaren,Pieri,01/02/1990,xx@yy.zz,CERT1,m,Claus
     1application_number,container_code,reg_number,firstname,lastname,date_of_birth,email,course1,sex,middlename,password
     2,dp2011,1001,Aaren,Pieri,01/02/1990,xx@yy.zz,CERT1,m,Claus,
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py

    r8290 r8291  
    3636from waeup.kofa.university.department import Department
    3737from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase
    38 from waeup.kofa.interfaces import IBatchProcessor
     38from waeup.kofa.interfaces import IBatchProcessor, IUserAccount
    3939
    4040
     
    316316        # Confirm that middlename has not been deleted.
    317317        container = self.app['applicants']['dp2011']
    318         for key in container.keys():
    319             if container[key].lastname == 'Pieri':
    320                 applicant = container[key]
    321                 break
    322         self.assertEqual(applicant.middlename, 'Peter')
     318        self.assertEqual(container['1234'].middlename, 'Peter')
    323319        # state of Pieri has not changed
    324320        self.assertEqual(container['1234'].state,'initialized')
    325321        # state of Finau has changed
    326322        self.assertEqual(container['2345'].state,'admitted')
     323        # password of Pieri has been set
     324        self.assertTrue(IUserAccount(container['1234']).checkPassword('mypwd1'))
     325        # password of Finau is still unset
     326        self.assertEqual(IUserAccount(container['2345']).password,'')
    327327        shutil.rmtree(os.path.dirname(fin_file))
    328328        # Now we import another file which clears all middlename attributes.
     
    330330            self.csv_file_update2, APPLICANT_HEADER_FIELDS_UPDATE, 'update')
    331331        self.assertEqual(num_warns,0)
    332         assert applicant.middlename is None
     332        assert container['1234'].middlename is None
    333333        shutil.rmtree(os.path.dirname(fin_file))
    334334
Note: See TracChangeset for help on using the changeset viewer.