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

Test password import.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.