Changeset 9788 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 7 Dec 2012, 10:57:53 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r9763 r9788 5 5 from zope.interface.verify import verifyObject, verifyClass 6 6 from waeup.kofa.interfaces import ICSVExporter 7 from waeup.kofa.students.catalog import StudentsQuery 7 8 from waeup.kofa.students.export import ( 8 9 StudentsExporter, StudentStudyCourseExporter, StudentStudyLevelExporter, 9 10 CourseTicketExporter, PaymentsExporter, BedTicketsExporter, 10 11 StudentPaymentsOverviewExporter, StudentStudyLevelsOverviewExporter, 11 get_students, StudentsExportFilter)12 get_students,) 12 13 from waeup.kofa.students.accommodation import BedTicket 13 14 from waeup.kofa.students.interfaces import ICSVStudentExporter … … 42 43 def test_get_students_by_session(self): 43 44 # we can filter out students of a certain session 44 my_filter1 = Students ExportFilter(current_session=2012)45 my_filter1 = StudentsQuery(current_session=2012) 45 46 result = get_students(self.app, stud_filter=my_filter1) 46 47 self.assertEqual(len(list(result)), 1) 47 48 48 my_filter2 = Students ExportFilter(current_session=1964)49 my_filter2 = StudentsQuery(current_session=1964) 49 50 result = get_students(self.app, stud_filter=my_filter2) 50 51 self.assertEqual(len(list(result)), 0) … … 53 54 def test_get_students_by_level(self): 54 55 # we can filter out students of a certain level 55 my_filter1 = Students ExportFilter(current_level=200)56 my_filter1 = StudentsQuery(current_level=200) 56 57 result = get_students(self.app, stud_filter=my_filter1) 57 58 self.assertEqual(len(list(result)), 1) 58 59 59 my_filter2 = Students ExportFilter(current_level=300)60 my_filter2 = StudentsQuery(current_level=300) 60 61 result = get_students(self.app, stud_filter=my_filter2) 61 62 self.assertEqual(len(list(result)), 0) … … 64 65 def test_get_students_by_deptcode(self): 65 66 # we can filter out students of a certain dept. 66 my_filter1 = Students ExportFilter(depcode='NA')67 my_filter1 = StudentsQuery(depcode='NA') 67 68 result = get_students(self.app, stud_filter=my_filter1) 68 69 self.assertEqual(len(list(result)), 1) 69 70 70 my_filter2 = Students ExportFilter(depcode='NOTEXISTING')71 my_filter2 = StudentsQuery(depcode='NOTEXISTING') 71 72 result = get_students(self.app, stud_filter=my_filter2) 72 73 self.assertEqual(len(list(result)), 0) … … 75 76 def test_get_students_by_faccode(self): 76 77 # we can filter out students of a certain faculty. 77 my_filter1 = Students ExportFilter(faccode='NA')78 my_filter1 = StudentsQuery(faccode='NA') 78 79 result = get_students(self.app, stud_filter=my_filter1) 79 80 self.assertEqual(len(list(result)), 1) 80 81 81 my_filter2 = Students ExportFilter(faccode='NOTEXISTING')82 my_filter2 = StudentsQuery(faccode='NOTEXISTING') 82 83 result = get_students(self.app, stud_filter=my_filter2) 83 84 self.assertEqual(len(list(result)), 0)
Note: See TracChangeset for help on using the changeset viewer.