Changeset 13156 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 8 Jul 2015, 05:22:18 (9 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/export.py
r13144 r13156 20 20 import os 21 21 import grok 22 from datetime import datetime 22 from datetime import datetime, timedelta 23 23 from zope.component import getUtility 24 24 from waeup.kofa.interfaces import ( … … 99 99 tz = getUtility(IKofaUtils).tzinfo 100 100 payments_start = tz.localize(payments_start) 101 payments_end = tz.localize(payments_end) 101 payments_end = tz.localize(payments_end) + timedelta(days=1) 102 102 if p_state: 103 103 # Only paid or unpaid tickets in payment period are considered -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r13103 r13156 849 849 payments_start='nonsense', payments_end='nonsense') 850 850 # If they match the format they are ignored by get_filtered and the 851 # exporter works properly 851 # exporter works properly. 852 # Attention: End day is included! 852 853 exporter.export_filtered( 853 854 self.app, self.outfile, 854 855 current_session=None, current_level=None, 855 payments_start='01/04/2012', payments_end='0 2/04/2012')856 payments_start='01/04/2012', payments_end='01/04/2012') 856 857 result = open(self.outfile, 'rb').read() 857 858 self.assertEqual( … … 865 866 'r-code,,A111111,created,2012\r\n' 866 867 ) 867 # no results if payment_date is outside the given period 868 # Payment date is 2012-04-01, 14:12:01. 869 # No results if payment_date is outside the given period. 868 870 exporter.export_filtered( 869 871 self.app, self.outfile, 870 872 current_session=None, current_level=None, 871 payments_start='3 1/03/2012', payments_end='01/04/2012')873 payments_start='30/03/2012', payments_end='31/03/2012') 872 874 result = open(self.outfile, 'rb').read() 873 875 self.assertEqual( … … 888 890 'r_code,r_desc,student_id,state,current_session\r\n' 889 891 ) 890 # no results if payment_date is not set892 # No results if payment_date is not set 891 893 self.payment.payment_date = None 892 894 exporter.export_filtered( 893 895 self.app, self.outfile, 894 896 current_session=None, current_level=None, 895 payments_start='01/04/2012', payments_end='02/04/2012') 896 result = open(self.outfile, 'rb').read() 897 897 payments_start='31/03/2012', payments_end='02/04/2012') 898 result = open(self.outfile, 'rb').read() 899 self.assertEqual( 900 result, 901 'ac,amount_auth,creation_date,p_category,p_current,p_id,' 902 'p_item,p_level,p_session,p_state,payment_date,r_amount_approved,' 903 'r_code,r_desc,student_id,state,current_session\r\n' 904 ) 898 905 return 899 906
Note: See TracChangeset for help on using the changeset viewer.