Changeset 9672 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 17 Nov 2012, 22:43:58 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports.py
r9670 r9672 128 128 self.data = get_students_by(session, mode) 129 129 130 def __repr__(self):131 """Creates an executable representation of a StudentsReport object.132 """133 return 'StudentsReport(%r, %r, author=%r)' % (134 self.args[0], self.mode, self.author)135 136 #def __str__(self):137 # """A nice human readable representation of a StudentsReport.138 139 # Includes infos about session, mode and creation datetime.140 # """141 # return 'Students Report [session=%s, mode=%s] of %s ' % (142 # self.session, self.mode, self._creation_dt_string)143 144 130 @property 145 131 def title(self): … … 169 155 title = _('Students') 170 156 grok.name('students_by') 171 172 @property173 def description(self):174 return self.title175 157 176 158 def generate(self, site, session=None, mode=None, author=None): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_reports.py
r9671 r9672 20 20 verifyObject(IStudentsReport, obj) 21 21 return 22 23 def test_repr(self):24 # exec(students_report.__repr__()) <=> students_report25 obj1 = StudentsReport(2010, 'Undergraduate Full-Time', author='Bob')26 self.assertEqual(27 obj1.__repr__(),28 "StudentsReport(2010, 'Undergraduate Full-Time', author='Bob')")29 obj_from_str = eval(obj1.__repr__())30 self.assertEqual(obj_from_str.session, '2010/2011')31 self.assertEqual(obj_from_str.mode, 'Undergraduate Full-Time')32 self.assertEqual(obj_from_str.author, 'Bob')33 return34 35 #def test_str(self):36 # # StudentsReport provide a nice string representation37 # obj = StudentsReport(2010, 'Undergraduate Full-Time', author='Bob')38 # self.assertEqual(39 # obj.__str__()[:65],40 # 'Students Report '41 # '[session=2010/2011, mode=Undergraduate Full-Time]')42 # return43 22 44 23 def test_title(self):
Note: See TracChangeset for help on using the changeset viewer.