Changeset 14557 for main/kofacustom.sampleuni
- Timestamp:
- 19 Feb 2017, 07:38:38 (8 years ago)
- Location:
- main/kofacustom.sampleuni/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.sampleuni/trunk/CHANGES.txt
r13827 r14557 5 5 ===================== 6 6 7 * Pin waeup.kofa 1. 4.17 * Pin waeup.kofa 1.5 8 8 9 9 * Adjust to layout changes made in base package. -
main/kofacustom.sampleuni/trunk/setup.py
r13827 r14557 9 9 'grokui.admin', 10 10 'grokcore.startup', 11 'waeup.kofa >= 1. 4.1',11 'waeup.kofa >= 1.5', 12 12 ], 13 13 -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/applicants/tests/test_browser.py
r12482 r14557 24 24 from zope.catalog.interfaces import ICatalog 25 25 from zope.intid.interfaces import IIntIds 26 from hurry.workflow.interfaces import IWorkflowState 26 27 from kofacustom.sampleuni.testing import FunctionalLayer 27 from waeup.kofa.schoolgrades import ResultEntry 28 from waeup.kofa.utils.utils import KofaUtils 28 from waeup.kofa.browser.tests.test_pdf import samples_dir 29 29 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup 30 30 from waeup.kofa.applicants.tests.test_batching import ApplicantImportExportSetup … … 55 55 applicant.lastname = u'Tester' 56 56 applicant.middlename = u'M.' 57 applicant.nationality = u'NG' 57 58 applicant.date_of_birth = datetime.date(1981, 2, 4) 58 59 applicant.sex = 'f' … … 63 64 applicant.course_admitted = self.certificate 64 65 applicant.notice = u'Some notice\nin lines.' 66 applicant.screening_score = 98 67 applicant.screening_venue = u'Exam Room' 68 applicant.screening_date = u'Saturday, 16th June 2012 2:00:00 PM' 65 69 applicant.password = 'any password' 66 result_entry = ResultEntry(67 KofaUtils.EXAM_SUBJECTS_DICT.keys()[0],68 KofaUtils.EXAM_GRADES[0][0]69 )70 applicant.school_grades = [71 result_entry]72 70 return applicant 73 71 74 def test_export_reimport_all(self): 75 # we can export all applicants in a portal 76 # set values we can expect in export file 77 self.applicant = self.setup_applicant(self.applicant) 78 exporter = CustomApplicantExporter() 79 exporter.export_all(self.app, self.outfile) 80 result = open(self.outfile, 'rb').read() 81 self.assertTrue( 82 'applicant_id,application_date,application_number,course1,course2,' 83 'course_admitted,date_of_birth,display_fullname,email,firstname,' 84 'history,lastname,locked,middlename,notice,password,phone,' 85 'reg_number,sex,special_application,state,' 86 'student_id,suspended,container_code\r\n' 87 'dp2011_654321,,654321,CERT1,CERT1,CERT1,1981-02-04#,' 88 'Anna M. Tester,anna@sample.com,Anna,' 89 in result) 90 self.assertTrue( 91 'Application initialized by system\'],' 92 'Tester,0,M.,"Some notice\nin lines.",any password,' 93 '+234-123-12345#,123456,f,,initialized,,0,dp2011\r\n' 94 in result) 95 # We can import the same file if we ignore some columns. 96 # Since the applicants_catalog hasn't been notified, the same 97 # record with same reg_number can be imported twice. 98 processor = CustomApplicantProcessor() 99 result = processor.doImport( 100 self.outfile, 101 ['ignore_applicant_id','application_date', 102 'ignore_application_number','course1','course2', 103 'course_admitted','date_of_birth', 104 'ignore_display_fullname','email','firstname', 105 'ignore_history','lastname','locked','middlename', 106 'notice','password','phone', 107 'reg_number','sex','special_application','state', 108 'student_id','suspended','container_code'], 109 mode='create') 110 num_succ, num_fail, finished_path, failed_path = result 111 #content = open(failed_path).read() 112 self.assertEqual(num_succ,1) 113 self.assertEqual(num_fail,0) 114 return 72 class ApplicantsContainerUITests(ApplicantsFullSetup): 73 # Tests for ApplicantsContainer class views and pages 74 75 layer = FunctionalLayer 76 77 def test_application_slip(self): 78 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 79 self.slip_path = self.view_path + '/application_slip.pdf' 80 self.browser.open(self.manage_path) 81 self.assertEqual(self.browser.headers['Status'], '200 Ok') 82 self.fill_correct_values() 83 self.browser.getControl("Save").click() 84 IWorkflowState(self.applicant).setState('submitted') 85 self.browser.open(self.manage_path) 86 self.browser.getLink("Download application slip").click() 87 self.assertEqual(self.browser.headers['Status'], '200 Ok') 88 self.assertEqual(self.browser.headers['Content-Type'], 89 'application/pdf') 90 path = os.path.join(samples_dir(), 'application_slip.pdf') 91 open(path, 'wb').write(self.browser.contents) 92 print "Sample application_slip.pdf written to %s" % path -
main/kofacustom.sampleuni/trunk/src/kofacustom/sampleuni/students/tests/test_export.py
r13289 r14557 4 4 from waeup.kofa.interfaces import ICSVExporter 5 5 from waeup.kofa.schoolgrades import ResultEntry 6 from waeup.kofa.students.tests.test_batching import StudentImportExportSetup 6 from waeup.kofa.students.tests.test_batching import ( 7 StudentImportExportSetup, curr_year) 7 8 from kofacustom.sampleuni.utils.utils import CustomKofaUtils 8 9 from kofacustom.sampleuni.students.export import ( … … 46 47 result = open(self.outfile, 'rb').read() 47 48 self.assertMatches( 48 'adm_code,cl earance_locked,clr_code,date_of_birth,email,'49 'employer,firstname, lastname,matric_number,middlename,'49 'adm_code,clr_code,date_of_birth,email,' 50 'employer,firstname,flash_notice,lastname,matric_number,middlename,' 50 51 'nationality,officer_comment,perm_address,personal_updated,' 51 52 'phone,reg_number,sex,student_id,suspended,suspended_comment,' 52 53 'password,state,history,certcode,is_postgrad,current_level,' 53 'current_session\r\nmy adm code, 0,my clr code,1981-02-04#,'54 'anna@sample.com,,Anna, Tester,234,M.,NG,,'54 'current_session\r\nmy adm code,my clr code,1981-02-04#,' 55 'anna@sample.com,,Anna,,Tester,234,M.,NG,,' 55 56 '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,123,' 56 57 'f,A111111,0,,,created,' … … 90 91 'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,' 91 92 'r_code,r_desc,student_id,state,current_session\r\n666,' 92 '12.12, 2012-04-01 13:12:01#,schoolfee,1,my-id,p-item,'93 '100, 2012,paid,2012-04-01 14:12:01#,12.12,r-code,,'94 'A111111,created,2012\r\n' ,95 result93 '12.12,%s-04-01 13:12:01#,schoolfee,1,my-id,p-item,' 94 '100,%s,paid,%s-04-01 14:12:01#,12.12,r-code,,' 95 'A111111,created,2012\r\n' 96 % (curr_year-6, curr_year-6, curr_year-6), result 96 97 ) 97 98 return -
main/kofacustom.sampleuni/trunk/versions.cfg
r13827 r14557 157 157 zope.xmlpickle = 3.4.0 158 158 159 # Added by buildout at 201 6-04-11 08:52:15.063438160 waeup.kofa = 1. 4.1159 # Added by buildout at 2017-02-19 08:18:44.136240 160 waeup.kofa = 1.5
Note: See TracChangeset for help on using the changeset viewer.