Changeset 7269


Ignore:
Timestamp:
4 Dec 2011, 17:41:40 (13 years ago)
Author:
Henrik Bettermann
Message:

Fix test and simplify if statements in batching.py.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/students/batching.py

    r7267 r7269  
    8484
    8585    def getLocator(self, row):
    86         if 'student_id' in row.keys() and row['student_id']:
     86        if row.get('student_id',None):
    8787            return 'student_id'
    88         elif 'reg_number' in row.keys() and row['reg_number']:
     88        elif row.get('reg_number',None):
    8989            return 'reg_number'
    90         elif 'matric_number' in row.keys() and row['matric_number']:
     90        elif row.get('matric_number',None):
    9191            return 'matric_number'
    9292        else:
  • main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py

    r7267 r7269  
    120120
    121121    def test_entryExists(self):
    122         self.assertFalse(assert self.importer.entryExists(
     122        self.assertFalse(self.importer.entryExists(
    123123            dict(student_id='ID_NONE'), self.app))
    124124        student = self.importer.getEntry(
Note: See TracChangeset for help on using the changeset viewer.