Changeset 7267 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 4 Dec 2011, 16:01:15 (13 years ago)
- 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
r7263 r7267 95 95 # The entry never exists in create mode. 96 96 def entryExists(self, row, site): 97 return self.getEntry(row, site) is not None 98 99 def getParent(self, row, site): 100 return site['students'] 101 102 def getEntry(self, row, site): 97 103 if not 'students' in site.keys(): 98 104 return None … … 117 123 return None 118 124 119 def getParent(self, row, site): 120 return site['students'] 121 122 def getEntry(self, row, site): 123 return self.entryExists(row, site) 124 125 125 126 def addEntry(self, obj, row, site): 126 127 parent = self.getParent(row, site) … … 129 130 130 131 def delEntry(self, row, site): 131 student = self. entryExists(row, site)132 student = self.getEntry(row, site) 132 133 if student is not None: 133 134 parent = self.getParent(row, site) … … 203 204 return True 204 205 205 def parentsExist(self, row, site):206 def getParent(self, row, site): 206 207 if not 'students' in site.keys(): 207 208 return None … … 227 228 return None 228 229 230 def parentsExist(self, row, site): 231 return self.getParent(row, site) is not None 232 229 233 def entryExists(self, row, site): 230 student = self. parentsExist(row, site)234 student = self.getParent(row, site) 231 235 if not student: 232 236 return None -
main/waeup.sirp/trunk/src/waeup/sirp/students/tests/test_batching.py
r7263 r7267 116 116 117 117 def test_parentsExist(self): 118 assert self.importer.parentsExist(None, dict()) is False119 assert self.importer.parentsExist(None, self.app) is True118 self.assertFalse(self.importer.parentsExist(None, dict())) 119 self.assertTrue(self.importer.parentsExist(None, self.app)) 120 120 121 121 def test_entryExists(self): 122 assert self.importer.entryExists(123 dict(student_id='ID_NONE'), self.app) is None122 self.assertFalse(assert self.importer.entryExists( 123 dict(student_id='ID_NONE'), self.app)) 124 124 student = self.importer.getEntry( 125 125 dict(student_id=self.student.student_id), self.app)
Note: See TracChangeset for help on using the changeset viewer.