Ignore:
Timestamp:
20 Nov 2012, 11:16:38 (12 years ago)
Author:
Henrik Bettermann
Message:

Replace 'has_key' by 'in'

File:
1 edited

Legend:

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

    r9326 r9701  
    316316        # former_course attribute of the corresponding course is set.
    317317        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    318         self.assertTrue(self.app['faculties']['fac1']['dep1'].certificates[
    319             'CERT1'].has_key('COURSE1_100'))
     318        self.assertTrue('COURSE1_100' in self.app[
     319            'faculties']['fac1']['dep1'].certificates['CERT1'])
    320320        self.browser.open(
    321321            'http://localhost/app/faculties/fac1/dep1/courses/COURSE1/manage')
    322322        self.browser.getControl(name="form.former_course").value = ['selected']
    323323        self.browser.getControl("Save").click()
    324         self.assertFalse(self.app['faculties']['fac1']['dep1'].certificates[
    325             'CERT1'].has_key('COURSE1_100'))
     324        self.assertFalse('COURSE1_100' in self.app[
     325            'faculties']['fac1']['dep1'].certificates['CERT1'])
    326326        return
    327327
     
    330330        # the corresponding course is removed.
    331331        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
    332         self.assertTrue(self.app['faculties']['fac1']['dep1'].certificates[
    333             'CERT1'].has_key('COURSE1_100'))
     332        self.assertTrue('COURSE1_100' in self.app[
     333            'faculties']['fac1']['dep1'].certificates['CERT1'])
    334334        self.browser.open('http://localhost/app/faculties/fac1/dep1/manage')
    335335        ctrl = self.browser.getControl(name='val_id')
    336336        ctrl.getControl(value='COURSE1').selected = True
    337337        self.browser.getControl("Remove selected", index=0).click()
    338         self.assertFalse(self.app['faculties']['fac1']['dep1'].certificates[
    339             'CERT1'].has_key('COURSE1_100'))
    340         return
     338        self.assertFalse('COURSE1_100' in self.app[
     339            'faculties']['fac1']['dep1'].certificates['CERT1'])
     340        return
Note: See TracChangeset for help on using the changeset viewer.