Changeset 14293 for main/waeup.kofa/trunk/src
- Timestamp:
- 25 Nov 2016, 10:06:54 (8 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r14286 r14293 370 370 return 371 371 372 @action(_('Create graduated student'), style='primary') 373 def addGraduatedStudent(self, **data): 374 student = createObject(u'waeup.Student') 375 self.applyData(student, **data) 376 self.context.addStudent(student) 377 IWorkflowState(student).setState(GRADUATED) 378 self.flash(_('Student record created.')) 379 self.redirect(self.url(self.context[student.student_id], 'index')) 380 return 381 372 382 class LoginAsStudentStep1(KofaEditFormPage): 373 383 """ View to temporarily set a student password. -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r14286 r14293 425 425 self.browser.getControl("Find student(s)").click() 426 426 self.assertTrue('No student found' in self.browser.contents) 427 return 428 429 def test_add_graduated_students(self): 430 # Managers can add search and remove students 431 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 432 self.browser.open(self.manage_container_path) 433 self.browser.getLink("Add student").click() 434 self.assertEqual(self.browser.headers['Status'], '200 Ok') 435 self.assertEqual(self.browser.url, self.add_student_path) 436 self.browser.getControl(name="form.firstname").value = 'Bob' 437 self.browser.getControl(name="form.lastname").value = 'Tester' 438 self.browser.getControl(name="form.reg_number").value = '1234' 439 self.browser.getControl("Create graduated student").click() 440 self.assertTrue('Student record created' in self.browser.contents) 441 self.assertEqual(self.app['students']['K1000001'].state, 'graduated') 427 442 return 428 443
Note: See TracChangeset for help on using the changeset viewer.