Changeset 8082 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 9 Apr 2012, 16:35:24 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8081 r8082 225 225 self.flash(_('Empty search string')) 226 226 return 227 if self.searchtype == 'current_session': 228 try: 229 self.searchterm = int(self.searchterm) 230 except ValueError: 231 self.flash('Only year dates allowed (e.g. 2011).') 232 return 227 233 if not 'entries' in form: 228 234 self.hitlist = search(query=self.searchterm, -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r8039 r8082 279 279 self.browser.getControl("Search").click() 280 280 self.assertTrue('Anna Tester' in self.browser.contents) 281 # Session fileds require integer values 282 self.browser.open(self.container_path) 283 self.browser.getControl(name="searchtype").value = ['current_session'] 284 self.browser.getControl(name="searchterm").value = '2004/2005' 285 self.browser.getControl("Search").click() 286 self.assertTrue('Only year dates allowed' in self.browser.contents) 287 self.browser.open(self.manage_container_path) 288 self.browser.getControl(name="searchtype").value = ['current_session'] 289 self.browser.getControl(name="searchterm").value = '2004/2005' 290 self.browser.getControl("Search").click() 291 self.assertTrue('Only year dates allowed' in self.browser.contents) 281 292 282 293 # We can find a student in a certain study_mode … … 338 349 self.assertTrue('Anna Tester' in self.browser.contents) 339 350 # The old searchterm will be used again 351 self.browser.getControl("Search").click() 352 self.assertTrue('Anna Tester' in self.browser.contents) 353 354 # The catalog is informed when studycourse objects have been 355 # edited 356 self.browser.open(self.studycourse_path + '/manage') 357 self.browser.getControl(name="form.current_session").value = ['2010'] 358 self.browser.getControl(name="form.entry_session").value = ['2010'] 359 self.browser.getControl(name="form.entry_mode").value = ['ug_ft'] 360 self.browser.getControl("Save").click() 361 362 # We can find the student in the new session 363 self.browser.open(self.manage_container_path) 364 self.browser.getControl(name="searchtype").value = ['current_session'] 365 self.browser.getControl(name="searchterm").value = '2010' 340 366 self.browser.getControl("Search").click() 341 367 self.assertTrue('Anna Tester' in self.browser.contents) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_catalog.py
r7811 r8082 63 63 self.student = self.app['students'][self.student_id] 64 64 self.student['studycourse'].certificate = self.certificate 65 self.student['studycourse'].current_session = 2010 65 66 # Update the students_catalog 66 67 notify(grok.ObjectModifiedEvent(self.student)) … … 128 129 assert results[0] is self.app['students'][self.student_id] 129 130 131 def test_search_by_session(self): 132 # We can find a student in a certain session 133 cat = queryUtility(ICatalog, name='students_catalog') 134 results = cat.searchResults(current_session=(2010,2010)) 135 results = [x for x in results] # Turn results generator into list 136 assert len(results) == 1 137 assert results[0] is self.app['students'][self.student_id] 138 130 139 class CourseTicketCatalogTests(CatalogTestSetup): 131 140
Note: See TracChangeset for help on using the changeset viewer.