Ignore:
Timestamp:
12 Oct 2023, 21:45:55 (13 months ago)
Author:
Henrik Bettermann
Message:

Customize LoginPage? to redirect to request_webservice instead of showing the login page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/students/tests/test_browser.py

    r15351 r17611  
    480480            '<h1 class="kofa-content-label">Edit clearance data</h1>'
    481481            in self.browser.contents)
     482
     483    def test_student_redirect_camefrom(self):
     484        payment1 = createObject(u'waeup.StudentOnlinePayment')
     485        payment1.p_id = "p4153206270"
     486        payment1.p_category = 'schoolfee'
     487        payment1.p_item = u'My School Fee'
     488        payment1.p_session = 2015
     489        payment1.p_level = 100
     490        payment1.p_current = True
     491        payment1.amount_auth = 23456.9
     492        payment1.approve()
     493        self.student['payments'][payment1.p_id] = payment1
     494        self.browser.open(self.login_path)
     495        self.browser.getControl(name="form.login").value = self.student_id
     496        self.browser.getControl(name="form.password").value = 'spwd'
     497        self.browser.getControl("Login").click()
     498        self.assertMatches(
     499            '...You logged in...', self.browser.contents)
     500        camefrom = '/students/K1000000/studycourse'
     501        self.browser.open(self.login_path + '?camefrom=%s' % camefrom)
     502        # nothing happens
     503        self.assertEqual(self.browser.url, self.login_path + '?camefrom=%s' % camefrom)
     504        camefrom = '/students/K1000000/payments/%s/request_webservice' % payment1.p_id
     505        # Kofa redirects to request_webservice and then returns to payment ticket index view
     506        self.browser.open(self.login_path + '?camefrom=%s' % camefrom)
     507        self.assertEqual(
     508            self.browser.url,
     509            'http://localhost/app/students/K1000000/payments/p4153206270/@@index')
Note: See TracChangeset for help on using the changeset viewer.