Changeset 9029 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 20 Jul 2012, 09:34:55 (12 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/batching.py
r9028 r9029 452 452 """ 453 453 current_level = row.get('current_level', None) 454 if current_level == '999' and obj.state in FORBIDDEN_POSTGRAD_STATES: 454 if current_level == '999' and \ 455 obj.__parent__.state in FORBIDDEN_POSTGRAD_STATES: 455 456 return 'Not a pg student.' 456 457 return None -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r9028 r9029 241 241 242 242 243 244 243 class StudentProcessorTest(StudentImportExportSetup): 245 244 … … 491 490 super(StudentStudyCourseProcessorTest, self).setUp() 492 491 492 # Add student with subobjects 493 student = Student() 494 self.app['students'].addStudent(student) 495 student = self.setup_student(student) 496 notify(grok.ObjectModifiedEvent(student)) 497 self.student = self.app['students'][student.student_id] 498 493 499 # Import students with subobjects 494 500 student_file = os.path.join(self.workdir, 'sample_student_data.csv') … … 537 543 dict(reg_number='1', current_level='100')) 538 544 self.assertEqual(len(errs),0) 545 546 def test_checkUpdateRequirements(self): 547 # Make sure that pg students can't be updated with wrong transition. 548 err = self.processor.checkUpdateRequirements(self.student['studycourse'], 549 dict(reg_number='1', current_level='100'), self.app) 550 self.assertTrue(err is None) 551 err = self.processor.checkUpdateRequirements(self.student['studycourse'], 552 dict(reg_number='1', current_level='999'), self.app) 553 self.assertTrue(err is None) 554 IWorkflowState(self.student).setState('returning') 555 err = self.processor.checkUpdateRequirements(self.student['studycourse'], 556 dict(reg_number='1', current_level='999'), self.app) 557 self.assertEqual(err, 'Not a pg student.') 539 558 540 559 def test_import(self): … … 672 691 self.assertEqual(num_warns,2) 673 692 shutil.rmtree(os.path.dirname(fin_file)) 674 675 693 676 694 class CourseTicketProcessorTest(StudentImportExportSetup):
Note: See TracChangeset for help on using the changeset viewer.