Changeset 12108
- Timestamp:
- 2 Dec 2014, 06:36:49 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_export.py
r12107 r12108 2 2 from zope.component import queryUtility 3 3 from zope.interface.verify import verifyObject, verifyClass 4 from hurry.workflow.interfaces import IWorkflowState 4 5 from waeup.kofa.interfaces import ICSVExporter 5 6 from waeup.kofa.schoolgrades import ResultEntry … … 8 9 from kofacustom.nigeria.utils.utils import NigeriaKofaUtils 9 10 from kofacustom.nigeria.students.export import ( 10 NigeriaStudentExporter, NigeriaStudentPaymentsExporter) 11 NigeriaStudentExporter, NigeriaStudentPaymentsExporter, 12 ClearanceRequestedStudentExporter) 11 13 from kofacustom.nigeria.testing import FunctionalLayer 12 14 … … 111 113 ) 112 114 return 115 116 class ClearanceRequestedStudentExporterTest(StudentImportExportSetup): 117 118 layer = FunctionalLayer 119 120 def setUp(self): 121 super(ClearanceRequestedStudentExporterTest, self).setUp() 122 self.setup_for_export() 123 return 124 125 def test_ifaces(self): 126 # make sure we fullfill interface contracts 127 obj = ClearanceRequestedStudentExporter() 128 verifyObject(ICSVExporter, obj) 129 verifyClass(ICSVExporter, ClearanceRequestedStudentExporter) 130 return 131 132 def test_export_all(self): 133 # we can really export students 134 # set values we can expect in export file 135 self.setup_student(self.student) 136 self.student.date_of_invitation = 'Come soon' 137 IWorkflowState(self.student).setState('clearance requested') 138 exporter = ClearanceRequestedStudentExporter() 139 exporter.export_all(self.app, self.outfile) 140 result = open(self.outfile, 'rb').read() 141 self.assertMatches( 142 'student_id,reg_number,display_fullname,state,current_session,' 143 'history,date_of_invitation\r\n' 144 'A111111,123,Anna M. Tester,clearance requested,' 145 '2012,2014-12-02 07:17:02 WAT - Record created by system,' 146 'Come soon\r\n', 147 result 148 ) 149 return
Note: See TracChangeset for help on using the changeset viewer.