- Timestamp:
- 25 Feb 2017, 17:59:16 (8 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_browser.py
r14406 r14591 29 29 from waeup.kofa.students.accommodation import BedTicket 30 30 from waeup.kofa.testing import FunctionalTestCase 31 from waeup.kofa.browser.tests.test_pdf import samples_dir 31 32 from waeup.kofa.interfaces import ( 32 33 IExtFileStore, IFileStoreNameChooser) … … 416 417 self.browser.contents) 417 418 return 419 420 def test_student_course_registration(self): 421 IWorkflowState(self.student).setState('school fee paid') 422 self.browser.open(self.login_path) 423 self.browser.getControl(name="form.login").value = self.student_id 424 self.browser.getControl(name="form.password").value = 'spwd' 425 self.browser.getControl("Login").click() 426 # Now students can add the current study level 427 self.browser.getLink("Study Course").click() 428 self.browser.getLink("Add course list").click() 429 self.assertMatches('...Add current level 100 (Year 1)...', 430 self.browser.contents) 431 self.browser.getControl("Create course list now").click() 432 # Students can't open the customized pdf course registration slip 433 self.browser.open( 434 self.student_path + '/studycourse/100/course_registration_slip.pdf') 435 self.assertEqual(self.browser.headers['Status'], '200 Ok') 436 self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf') 437 path = os.path.join(samples_dir(), 'course_registration_slip.pdf') 438 open(path, 'wb').write(self.browser.contents) 439 print "Sample PDF course_registration_slip.pdf written to %s" % path -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/tests/test_utils.py
r14586 r14591 31 31 return 32 32 33 def test_ maxCreditsExceeded(self):33 def test_warnCreditsOOR(self): 34 34 students_utils = getUtility(IStudentsUtils) 35 35 studylevel = grok.Container() 36 studylevel.total_credits = 40 36 studylevel.total_credits_s1 = 17 37 studylevel.total_credits_s2 = 17 37 38 course = grok.Model() 38 course.credits = 18 39 course.credits = 7 40 course.semester = 1 39 41 warning = students_utils.warnCreditsOOR(studylevel, course) 40 42 self.assertEqual(warning, None) 41 course.credits = 1943 course.credits = 8 42 44 warning = students_utils.warnCreditsOOR(studylevel, course) 43 self.assertEqual(warning, 'Maximum credits exceeded.') 45 self.assertEqual(warning, 'Maximum credits in 1st semester exceeded.') 46 course.semester = 2 47 warning = students_utils.warnCreditsOOR(studylevel, course) 48 self.assertEqual(warning, 'Maximum credits in 2nd semester exceeded.') 49 warning = students_utils.warnCreditsOOR(studylevel) 50 self.assertEqual(warning, 'Minimum credits in 1st semester not reached.') 51 studylevel.total_credits_s1 = 18 52 warning = students_utils.warnCreditsOOR(studylevel) 53 self.assertEqual(warning, 'Minimum credits in 2nd semester not reached.') 44 54 return 45 55
Note: See TracChangeset for help on using the changeset viewer.