Changeset 10574 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 1 Sep 2013, 08:11:34 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students/reports
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py
r10572 r10574 1 1 ## $Id$ 2 2 ## 3 ## Copyright (C) 201 2Uli Fouquet & Henrik Bettermann3 ## Copyright (C) 2013 Uli Fouquet & Henrik Bettermann 4 4 ## This program is free software; you can redistribute it and/or modify 5 5 ## it under the terms of the GNU General Public License as published by … … 35 35 creation_dt_string = Attribute('Human readable report creation datetime') 36 36 37 def get_students _by(faccode, depcode, session, level):37 def get_students(faccode, depcode, session, level): 38 38 """Get students in a certain department who registered courses 39 39 in a certain session at a certain level. … … 42 42 """ 43 43 site = grok.getSite() 44 faccodes = tuple(sorted([x for x in site['faculties'].keys()],45 key=lambda x: x.lower()))46 44 cat = queryUtility(ICatalog, name="students_catalog") 47 45 result = cat.searchResults( … … 142 140 self.creation_dt_string = self.creation_dt.astimezone( 143 141 getUtility(IKofaUtils).tzinfo).strftime("%Y-%m-%d %H:%M:%S %Z") 144 self.data = get_students _by(faccode, depcode, session, level)142 self.data = get_students(faccode, depcode, session, level) 145 143 146 144 def create_pdf(self): -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py
r10564 r10574 5 5 from waeup.kofa.interfaces import IJobManager 6 6 from waeup.kofa.students.reports.level_report import ( 7 get_students _by, LevelReport, ILevelReport)7 get_students, LevelReport, ILevelReport) 8 8 from waeup.kofa.students.tests.test_catalog import CatalogTestSetup 9 9 from waeup.kofa.students.tests.test_browser import StudentsFullSetup … … 23 23 return 24 24 25 def test_get_students _by(self):25 def test_get_students(self): 26 26 # we can get a table with one student 27 result = get_students _by('fac1', 'dep1', 2010, 100)27 result = get_students('fac1', 'dep1', 2010, 100) 28 28 self.assertEqual(result, 29 29 [(u'K1000000', u'1234', u'Bob Tester', 30, 30, 5.0, [])]) -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_statistics.py
r10559 r10574 29 29 return 30 30 31 def test_get_student_stats_ by_session_simple(self):31 def test_get_student_stats_session_simple(self): 32 32 # we can get a table with one student 33 33 result1 = get_student_stats(2010, 'Undergraduate Full-Time') … … 47 47 return 48 48 49 def test_get_student_stats_ by_session_multiple(self):49 def test_get_student_stats_session_multiple(self): 50 50 # we can get a table with several students 51 51 self.create_cert('fac2', 'dept2', 'CERT2')
Note: See TracChangeset for help on using the changeset viewer.