- Timestamp:
- 28 Nov 2012, 07:52:56 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r9706 r9735 575 575 576 576 def test_checkUpdateRequirements(self): 577 # Make sure that pg students can't be updated with wrong transition. 577 # Current level must be in range of certificate. 578 # Since row has passed the converter, current_level is an integer. 578 579 err = self.processor.checkUpdateRequirements( 579 580 self.student['studycourse'], 580 dict(reg_number='1', current_level='100'), self.app) 581 dict(reg_number='1', current_level=100), self.app) 582 self.assertEqual(err, 'current_level not in range.') 583 err = self.processor.checkUpdateRequirements( 584 self.student['studycourse'], 585 dict(reg_number='1', current_level=200), self.app) 581 586 self.assertTrue(err is None) 582 # Since row has passed the converter, current_level is an integer. 587 # We can update pg students. 588 self.student['studycourse'].certificate.start_level=999 589 self.student['studycourse'].certificate.end_level=999 583 590 err = self.processor.checkUpdateRequirements( 584 591 self.student['studycourse'], 585 592 dict(reg_number='1', current_level=999), self.app) 586 593 self.assertTrue(err is None) 594 # Make sure that pg students can't be updated with wrong transition. 587 595 IWorkflowState(self.student).setState('returning') 588 596 err = self.processor.checkUpdateRequirements( … … 590 598 dict(reg_number='1', current_level=999), self.app) 591 599 self.assertEqual(err, 'Not a pg student.') 600 # If certificate is not given in row (and has thus 601 # successfully passed checkConversion) the certificate 602 # attribute must be set. 603 self.student['studycourse'].certificate = None 604 err = self.processor.checkUpdateRequirements( 605 self.student['studycourse'], 606 dict(reg_number='1', current_level=100), self.app) 607 self.assertEqual(err, 'No certificate to check level.') 592 608 593 609 def test_import(self):
Note: See TracChangeset for help on using the changeset viewer.