Changeset 9264 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 1 Oct 2012, 15:51:42 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_catalog.py
r8244 r9264 36 36 layer = FunctionalLayer 37 37 38 def create_cert(self, facname, deptname, certname): 39 # helper: create faculty, dept, and cert 40 self.app['faculties'][facname] = Faculty(code=facname) 41 self.app['faculties'][facname][deptname] = Department(code=deptname) 42 cert = createObject('waeup.Certificate') 43 cert.code = certname 44 self.app['faculties'][facname][deptname].certificates.addCertificate( 45 cert) 46 return cert 47 38 48 def setUp(self): 39 49 super(CatalogTestSetup, self).setUp() … … 48 58 self.app = self.getRootFolder()['app'] 49 59 setSite(self.app) 50 self.certificate = createObject('waeup.Certificate') 51 self.certificate.code = u'CERT1' 52 self.app['faculties']['fac1'] = Faculty(code=u'fac1') 53 self.app['faculties']['fac1']['dep1'] = Department(code=u'dep1') 54 self.app['faculties']['fac1']['dep1'].certificates.addCertificate( 55 self.certificate) 60 self.certificate = self.create_cert(u'fac1', u'dep1', u'CERT1') 56 61 57 62 # Create student with subobjects … … 99 104 # We can find a certain student id 100 105 cat = queryUtility(ICatalog, name='students_catalog') 101 results = cat.searchResults(student_id=(self.student_id, self.student_id)) 106 results = cat.searchResults(student_id=(self.student_id, 107 self.student_id)) 102 108 results = [x for x in results] # Turn results generator into list 103 109 assert len(results) == 1
Note: See TracChangeset for help on using the changeset viewer.