Changeset 9835
- Timestamp:
- 6 Jan 2013, 21:43:17 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r9826 r9835 70 70 from waeup.kofa.datacenter import DataCenterFile 71 71 72 from waeup.kofa.students.export import EXPORTER_NAMES as STUDENT_EXPORTERS 73 72 74 grok.context(IKofaObject) 73 75 grok.templatedir('templates') … … 1543 1545 utils = getUtilitiesFor(ICSVExporter) 1544 1546 title_name_tuples = [ 1545 (util.title, name) for name, util in utils] 1547 (util.title, name) for name, util in utils 1548 if not name in STUDENT_EXPORTERS] 1546 1549 # The exporter for access codes requires a special permission. 1547 1550 if not checkPermission('waeup.manageACBatches', self.context): -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterexportpage.pt
r9822 r9835 1 1 <p i18n:translate=""> 2 Here you can create CSV files from parts of portal data .2 Here you can create CSV files from parts of portal data except student data. 3 3 Please pick the type of objects you want to export from the 4 4 selection below. The file will be generated and then be … … 29 29 </div> 30 30 </form> 31 32 <br /> 33 34 <p i18n:translate=""> 35 Student data exports have to be further configured. You can create CSV files 36 on the corresponding <a href="jobconfig">configuration page</a>. 37 </p> 31 38 32 39 <br /><br /> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_browser.py
r9827 r9835 278 278 in self.browser.contents) 279 279 280 def test_export_students(self): 281 # we can trigger export file creation 282 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 283 self.browser.open(self.datacenter_path) 284 self.assertEqual(self.browser.headers['Status'], '200 Ok') 285 self.assertEqual(self.browser.url, self.datacenter_path) 286 self.browser.getLink("Export data").click() 287 self.browser.getLink("configuration page").click() 288 self.browser.getControl(name="exporter").value = ['students'] 289 self.browser.getControl(name="session").value = ['all'] 290 self.browser.getControl(name="level").value = ['all'] 291 self.browser.getControl(name="mode").value = ['all'] 292 self.browser.getControl("Create CSV file").click() 293 self.assertEqual(self.browser.headers['Status'], '200 Ok') 294 job_id = self.wait_for_export_job_completed() 295 self.browser.open(self.datacenter_path + '/export') 296 self.browser.getLink("Download").click() 297 self.assertEqual(self.browser.headers['content-type'], 298 'text/csv; charset=UTF-8') 299 self.assertEqual(self.browser.headers['content-disposition'], 300 'attachment; filename="WAeUP.Kofa_students.csv') 301 # No students yet 302 self.assertEqual(self.browser.contents, 303 'adm_code,clearance_locked,clr_code,date_of_birth,email,' 304 'employer,firstname,lastname,matric_number,middlename,' 305 'nationality,officer_comment,perm_address,personal_updated,' 306 'phone,reg_number,sex,student_id,suspended,suspended_comment,' 307 'password,state,history,certcode,is_postgrad,current_level,' 308 'current_session\r\n') 309 self.cleanup_run_job() 310 return 311 280 312 def test_export_discard(self): 281 313 # we can discard a generated export result -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r9833 r9835 2653 2653 2654 2654 class ExportJobContainerOverview(KofaPage): 2655 """Page that filters and lists students. 2655 """Page that lists active student data export jobs and provides links 2656 to discard or download CSV files. 2657 2656 2658 """ 2657 2659 grok.context(VirtualExportJobContainer) … … 2684 2686 label = _('Configure student data export') 2685 2687 pnav = 1 2688 redirect_target = '' 2686 2689 2687 2690 def _set_session_values(self): … … 2740 2743 ' current_session=%s, current_level=%s, study_mode=%s' % ( 2741 2744 session, level, mode)) 2745 self.redirect(self.url(self.redirect_target)) 2742 2746 return 2743 2747 2744 2748 class ExportJobContainerDownload(ExportCSVView): 2745 """Page that configures a students export job. 2749 """Page that downloads a students export csv file. 2750 2746 2751 """ 2747 2752 grok.context(VirtualExportJobContainer) … … 2753 2758 """ 2754 2759 grok.context(IDataCenter) 2755 2760 redirect_target = '@@export' 2756 2761 2757 2762 class DepartmentExportJobContainerJobConfig(ExportJobContainerJobConfig): -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportjobsjobconfig.pt
r9819 r9835 50 50 <div class="input"> 51 51 <input type="submit" name="START" i18n:translate="" 52 value="Create export now"52 value="Create CSV file" 53 53 class="btn primary" /> 54 54 </div> -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9830 r9835 2752 2752 self.browser.getControl(name="level").value = ['100'] 2753 2753 self.browser.getControl(name="mode").value = ['ug_ft'] 2754 self.browser.getControl("Create export now").click()2754 self.browser.getControl("Create CSV file").click() 2755 2755 2756 2756 # When the job is finished and we reload the page...
Note: See TracChangeset for help on using the changeset viewer.