Ignore:
Timestamp:
9 Jul 2014, 12:46:08 (10 years ago)
Author:
Henrik Bettermann
Message:

Catch error if payment_date and payment is None.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/export.py

    r11730 r11756  
    108108            for student in students:
    109109                for payment in student.get('payments', {}).values():
    110                     if payment.p_state == 'paid' and \
     110                    if payment.payment_date and payment.p_state == 'paid' and \
    111111                        payment.payment_date > payments_start and \
    112112                        payment.payment_date < payments_end:
     
    116116            for student in students:
    117117                for payment in student.get('payments', {}).values():
    118                     if payment.payment_date > payments_start and \
     118                    if payment.payment_date and payment.payment_date > payments_start and \
    119119                        payment.payment_date < payments_end:
    120120                        payments.append(payment)
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r11699 r11756  
    287287        payment.r_code = u'r-code'
    288288        # XXX: there is no addPayment method to give predictable names
    289         student['payments']['my-payment'] = payment
     289        self.payment = student['payments']['my-payment'] = payment
    290290        return payment
    291291
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py

    r11737 r11756  
    817817            'r_code,r_desc,student_id,state,current_session\r\n'
    818818            )
     819        # no results if payment_date is not set
     820        self.payment.payment_date = None
     821        exporter.export_filtered(
     822            self.app, self.outfile,
     823            current_session=None, current_level=None,
     824            payments_start='01/04/2012', payments_end='02/04/2012')
     825        result = open(self.outfile, 'rb').read()
     826       
    819827        return
    820828
Note: See TracChangeset for help on using the changeset viewer.