Changeset 13059 for main/waeup.aaue/trunk/src
- Timestamp:
- 16 Jun 2015, 13:31:37 (10 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/students/browser.py
r13051 r13059 29 29 CourseTicketAddFormPage, 30 30 StudyLevelDisplayFormPage, 31 ExportPDFTranscript Page,32 ExportPDFAdmissionSlip Page,31 ExportPDFTranscriptSlip, 32 ExportPDFAdmissionSlip, 33 33 ) 34 34 from kofacustom.nigeria.students.browser import ( 35 35 NigeriaOnlinePaymentDisplayFormPage, 36 36 NigeriaOnlinePaymentAddFormPage, 37 NigeriaExportPDFPaymentSlip Page,38 NigeriaExportPDFCourseRegistrationSlip Page,39 NigeriaExportPDFClearanceSlip Page,37 NigeriaExportPDFPaymentSlip, 38 NigeriaExportPDFCourseRegistrationSlip, 39 NigeriaExportPDFClearanceSlip, 40 40 ) 41 41 from waeup.aaue.students.interfaces import ( … … 65 65 'p_category') 66 66 67 class CustomExportPDFPaymentSlip Page(NigeriaExportPDFPaymentSlipPage):67 class CustomExportPDFPaymentSlip(NigeriaExportPDFPaymentSlip): 68 68 """Deliver a PDF slip of the context. 69 69 """ … … 93 93 'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 94 94 95 class CustomExportPDFCourseRegistrationSlip Page(96 NigeriaExportPDFCourseRegistrationSlip Page):95 class CustomExportPDFCourseRegistrationSlip( 96 NigeriaExportPDFCourseRegistrationSlip): 97 97 """Deliver a PDF slip of the context. 98 98 """ … … 190 190 ) 191 191 192 class CustomExportPDFTranscript Page(ExportPDFTranscriptPage):192 class CustomExportPDFTranscriptSlip(ExportPDFTranscriptSlip): 193 193 """Deliver a PDF slip of the context. 194 194 """ … … 202 202 'Exams, Records and Data Processing Division <br /> For: Registrar')],) 203 203 204 class CustomExportPDFAdmissionSlip Page(ExportPDFAdmissionSlipPage):204 class CustomExportPDFAdmissionSlip(ExportPDFAdmissionSlip): 205 205 """Deliver a PDF Admission slip. 206 206 """ … … 213 213 + ' %s' % self.context.display_fullname 214 214 215 class CustomExportPDFClearanceSlip Page(NigeriaExportPDFClearanceSlipPage):215 class CustomExportPDFClearanceSlip(NigeriaExportPDFClearanceSlip): 216 216 """Deliver a PDF slip of the context. 217 217 """ … … 245 245 return 246 246 247 class ExportPDFMatricNumberSlip Page(UtilityView, grok.View):247 class ExportPDFMatricNumberSlip(UtilityView, grok.View): 248 248 """Deliver a PDF notification slip. 249 249 """ -
main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_browser.py
r13051 r13059 25 25 from hurry.workflow.interfaces import IWorkflowState 26 26 from zope.component.hooks import setSite, clearSite 27 from zope.component import getUtility, createObject 27 from zope.component import getUtility, createObject, queryUtility 28 from zope.catalog.interfaces import ICatalog 28 29 from waeup.kofa.app import University 29 30 from waeup.kofa.students.tests.test_browser import StudentsFullSetup … … 99 100 return 100 101 101 class StudentUITests(StudentsFullSetup):102 """Tests for customized student class views and pages103 """104 105 layer = FunctionalLayer106 107 def setUp(self):108 super(StudentUITests, self).setUp()109 110 bedticket = BedTicket()111 bedticket.booking_session = 2004112 bedticket.bed_type = u'any bed type'113 bedticket.bed = self.app['hostels']['hall-1']['hall-1_A_101_A']114 bedticket.bed_coordinates = u'My bed coordinates'115 self.student['accommodation'].addBedTicket(bedticket)116 117 102 def test_manage_payments(self): 118 103 # Add missing configuration data … … 245 230 self.assertMatches('...Session configuration object is not...', 246 231 self.browser.contents) 232 233 def test_manage_payments_bypass_ac_creation(self): 234 self.app['configuration']['2004'].school_fee_1 = 6666.0 235 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 236 self.browser.open(self.payments_path) 237 IWorkflowState(self.student).setState('cleared') 238 self.browser.getLink("Add current session payment ticket").click() 239 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 240 self.browser.getControl("Create ticket").click() 241 ctrl = self.browser.getControl(name='val_id') 242 value = ctrl.options[0] 243 self.browser.getLink(value).click() 244 payment_url = self.browser.url 245 logfile = os.path.join( 246 self.app['datacenter'].storage, 'logs', 'students.log') 247 # The ticket can be found in the payments_catalog 248 cat = queryUtility(ICatalog, name='payments_catalog') 249 results = list(cat.searchResults(p_state=('unpaid', 'unpaid'))) 250 self.assertTrue(len(results), 1) 251 self.assertTrue(results[0] is self.student['payments'][value]) 252 # Managers can approve the payment 253 self.browser.open(payment_url) 254 self.browser.getLink("Approve payment").click() 255 self.assertMatches('...Payment approved...', 256 self.browser.contents) 257 # Approval is logged in students.log ... 258 logcontent = open(logfile).read() 259 self.assertTrue( 260 'zope.mgr - students.browser.OnlinePaymentApproveView ' 261 '- E1000000 - schoolfee payment approved' 262 in logcontent) 263 # ... and in payments.log 264 logfile = os.path.join( 265 self.app['datacenter'].storage, 'logs', 'payments.log') 266 logcontent = open(logfile).read() 267 self.assertTrue( 268 '"zope.mgr",E1000000,%s,schoolfee,6666.0,AP,,,,,,\n' % value 269 in logcontent) 270 # Student is in state school fee paid, no activation 271 # code was necessary. 272 self.assertEqual(self.student.state, 'school fee paid') 273 self.assertEqual(len(self.app['accesscodes']['SFE-0']),0) 274 return 275 276 class StudentUITests(StudentsFullSetup): 277 """Tests for customized student class views and pages 278 """ 279 280 layer = FunctionalLayer 281 282 def setUp(self): 283 super(StudentUITests, self).setUp() 284 285 bedticket = BedTicket() 286 bedticket.booking_session = 2004 287 bedticket.bed_type = u'any bed type' 288 bedticket.bed = self.app['hostels']['hall-1']['hall-1_A_101_A'] 289 bedticket.bed_coordinates = u'My bed coordinates' 290 self.student['accommodation'].addBedTicket(bedticket) 247 291 248 292 def test_student_payments(self):
Note: See TracChangeset for help on using the changeset viewer.