Ignore:
Timestamp:
3 Jul 2014, 09:04:34 (10 years ago)
Author:
Henrik Bettermann
Message:

Application payment slips can only be downloaded if application form is submitted.

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

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r11726 r11729  
    55===================
    66
    7 * Option for additional passport upload requirements added.
     7* Application payment slips can only be downloaded if application form is
     8  submitted.
     9
     10* Method for additional passport upload requirements added.
    811
    912* Remove unused rowadd javascript function.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r11727 r11729  
    739739
    740740    def render(self):
    741         if self.context.__parent__.special \
    742             and self.context.__parent__.state != SUBMITTED:
     741        if self.context.__parent__.state != SUBMITTED:
    743742            self.flash(_('Please submit the application form before '
    744743                         'trying to download payment slips.'), type='warning')
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r11601 r11729  
    847847        # We approve the payment by bypassing the view
    848848        payment.approve()
    849         # The payment slip can be downloaded now
    850         self.browser.open(payment_url)
    851         self.browser.getLink("Download payment slip").click()
    852         self.assertEqual(self.browser.headers['Status'], '200 Ok')
    853         self.assertEqual(self.browser.headers['Content-Type'],
    854                          'application/pdf')
    855849        # Applicant is is not yet in state 'paid' because it was only
    856850        # the payment which we set to paid
     
    890884            % (self.applicant.applicant_id, payment.p_id)
    891885            in logcontent)
     886        # Payment slips can't be downloaded ...
     887        payment_id = self.applicant.keys()[0]
     888        self.browser.open(self.view_path + '/' + payment_id)
     889        self.browser.getLink("Download payment slip").click()
     890        self.assertTrue(
     891            'Please submit the application form before trying to download payment slips.'
     892            in self.browser.contents)
     893        # ... unless form is submitted.
     894        self.browser.open(self.view_path + '/edit')
     895        image = open(SAMPLE_IMAGE, 'rb')
     896        ctrl = self.browser.getControl(name='form.passport')
     897        file_ctrl = ctrl.mech_control
     898        file_ctrl.add_file(image, filename='myphoto.jpg')
     899        self.browser.getControl(name="confirm_passport").value = True
     900        self.browser.getControl("Final Submit").click()
     901        self.browser.open(self.view_path + '/' + payment_id)
     902        self.browser.getLink("Download payment slip").click()
     903        self.assertEqual(self.browser.headers['Content-Type'],
     904                 'application/pdf')
    892905        return
    893906
Note: See TracChangeset for help on using the changeset viewer.