Ignore:
Timestamp:
26 Apr 2012, 06:39:36 (13 years ago)
Author:
Henrik Bettermann
Message:

Add payment object after creation.

Adjust tests.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r8262 r8280  
    462462        except KeyError:
    463463            self.flash(_('Session configuration object is not available.'))
     464            self.redirect(self.url(self.context))
    464465            return
    465466        timestamp = "%d" % int(time()*1000)
     
    480481        self.context[payment.p_id] = payment
    481482        self.flash(_('Payment ticket created.'))
     483        self.redirect(self.url(payment))
    482484        return
    483485
    484486    def render(self):
    485         usertype = getattr(self.request.principal, 'user_type', None)
    486         if usertype == 'applicant':
    487             self.redirect(self.url(self.context, '@@edit'))
    488             return
    489         self.redirect(self.url(self.context, '@@manage'))
    490487        return
    491488
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r8264 r8280  
    437437        # There is a correct <img> link included
    438438        self.assertTrue(
    439               '<img src="passport.jpg" />' in self.browser.contents)
     439              '<img src="passport.jpg" height="180px" />' in self.browser.contents)
    440440        # Browsing the link shows a real image
    441441        self.browser.open(self.image_url('passport.jpg'))
     
    452452        # There is a correct <img> link included
    453453        self.assertTrue(
    454             '<img src="passport.jpg" />' in self.browser.contents)
     454            '<img src="passport.jpg" height="180px" />' in self.browser.contents)
    455455        # Browsing the link shows a real image
    456456        self.browser.open(self.image_url('passport.jpg'))
     
    473473        # There is a correct <img> link included
    474474        self.assertTrue(
    475             '<img src="passport.jpg" />' in self.browser.contents)
     475            '<img src="passport.jpg" height="180px" />' in self.browser.contents)
    476476        # We get a warning message
    477477        self.assertTrue(
     
    502502        # There is a correct <img> link included
    503503        self.assertTrue(
    504             '<img src="passport.jpg" />' in self.browser.contents)
     504            '<img src="passport.jpg" height="180px" />' in self.browser.contents)
    505505        # Browsing the link shows a real image
    506506        self.browser.open(self.image_url('passport.jpg'))
     
    541541        # There is a correct <img> link included
    542542        self.assertTrue(
    543             '<img src="passport.jpg" />' in self.browser.contents)
     543            '<img src="passport.jpg" height="180px" />' in self.browser.contents)
    544544        # Browsing the link shows a real image
    545545        self.browser.open(self.image_url('passport.jpg'))
     
    620620        self.assertMatches('...Payment ticket created...',
    621621                           self.browser.contents)
     622        self.assertMatches('...Activation Code...',
     623                           self.browser.contents)
    622624        # Payment ticket can be removed if they haven't received a
    623625        # valid callback
     626        self.browser.open(self.edit_path)
    624627        ctrl = self.browser.getControl(name='val_id')
    625628        value = ctrl.options[0]
     
    629632        # We will try the callback request view
    630633        self.browser.getControl("Add online payment ticket").click()
     634        self.browser.open(self.edit_path)
    631635        ctrl = self.browser.getControl(name='val_id')
    632636        value = ctrl.options[0]
     
    640644        #                   self.browser.contents)
    641645        # Request callback
    642         self.browser.open(payment_url)
    643646        self.browser.getLink("Request callback").click()
    644647        self.assertMatches('...Valid callback received...',
Note: See TracChangeset for help on using the changeset viewer.