Changeset 9517 for main/waeup.kofa/trunk/src/waeup/kofa/students/tests
- Timestamp:
- 3 Nov 2012, 18:47:31 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r9516 r9517 760 760 self.browser.open(self.payments_path) 761 761 IWorkflowState(self.student).setState('cleared') 762 self.browser.get Control("Add onlinepayment ticket").click()762 self.browser.getLink("Add current session payment ticket").click() 763 763 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 764 764 self.browser.getControl("Create ticket").click() … … 781 781 # can be initialized a second time if the former ticket is not yet paid. 782 782 self.browser.open(self.payments_path) 783 self.browser.get Control("Add onlinepayment ticket").click()783 self.browser.getLink("Add current session payment ticket").click() 784 784 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 785 785 self.browser.getControl("Create ticket").click() … … 827 827 # (with same p_item, p_session and p_category) can be added 828 828 self.browser.open(self.payments_path) 829 self.browser.get Control("Add onlinepayment ticket").click()829 self.browser.getLink("Add current session payment ticket").click() 830 830 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 831 831 self.browser.getControl("Create ticket").click() … … 833 833 '...This type of payment has already been made...', 834 834 self.browser.contents) 835 # The PreviousPaymentAddFormPage opens836 self.assertEqual(self.browser.url, self.payments_path + '/@@addpp')837 835 838 836 # Managers can open the pdf payment slip … … 887 885 self.browser.addHeader('Authorization', 'Basic mgr:mgrpw') 888 886 self.browser.open(self.payments_path) 889 self.browser.get Control("Add onlinepayment ticket").click()887 self.browser.getLink("Add current session payment ticket").click() 890 888 self.browser.getControl(name="form.p_category").value = ['bed_allocation'] 891 889 # If student is not in accommodation session, payment cannot be processed … … 895 893 self.browser.contents) 896 894 self.app['hostels'].accommodation_session = 2004 897 self.browser.get Control("Add onlinepayment ticket").click()895 self.browser.getLink("Add current session payment ticket").click() 898 896 self.browser.getControl(name="form.p_category").value = ['bed_allocation'] 899 897 self.browser.getControl("Create ticket").click() … … 2046 2044 self.assertRaises( 2047 2045 LookupError, self.browser.getControl, name='val_id') 2048 self.browser.get Control("Add onlinepayment ticket").click()2046 self.browser.getLink("Add current session payment ticket").click() 2049 2047 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 2050 2048 self.browser.getControl("Create ticket").click() … … 2136 2134 configuration2.booking_fee = 123.4 2137 2135 self.app['configuration'].addSessionConfiguration(configuration2) 2138 2136 configuration3 = createObject('waeup.SessionConfiguration') 2137 configuration3.academic_session = 2005 2138 configuration3.clearance_fee = 3456.0 2139 configuration3.booking_fee = 123.4 2140 self.app['configuration'].addSessionConfiguration(configuration3) 2139 2141 self.student['studycourse'].entry_session = 2002 2140 2142 … … 2148 2150 IWorkflowState(self.student).setState('courses registered') 2149 2151 self.browser.open(self.payments_path) 2150 self.browser.getControl("Add online payment ticket").click() 2151 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 2152 self.browser.getControl("Create ticket").click() 2153 2154 # Amount cannot be determined since the state is not 2155 # 'cleared' or 'returning' 2156 self.assertMatches('...Amount could not be determined...', 2157 self.browser.contents) 2158 self.assertMatches('...Would you like to pay for a previous session?...', 2159 self.browser.contents) 2152 self.browser.getLink("Add previous session payment ticket").click() 2160 2153 2161 2154 # Previous session payment form is provided 2155 self.assertEqual(self.student.current_session, 2004) 2162 2156 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 2163 2157 self.browser.getControl(name="form.p_session").value = ['2000'] … … 2167 2161 self.browser.contents) 2168 2162 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 2169 self.browser.getControl(name="form.p_session").value = ['200 4']2163 self.browser.getControl(name="form.p_session").value = ['2005'] 2170 2164 self.browser.getControl(name="form.p_level").value = ['300'] 2171 2165 self.browser.getControl("Create ticket").click() 2172 2166 self.assertMatches('...This is not a previous session...', 2173 2167 self.browser.contents) 2168 # Students can pay current session school fee. 2174 2169 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 2175 self.browser.getControl(name="form.p_session").value = ['200 3']2170 self.browser.getControl(name="form.p_session").value = ['2004'] 2176 2171 self.browser.getControl(name="form.p_level").value = ['300'] 2177 2172 self.browser.getControl("Create ticket").click() … … 2186 2181 2187 2182 # Payment session is properly set 2188 self.assertEqual(self.student['payments'][value].p_session, 200 3)2183 self.assertEqual(self.student['payments'][value].p_session, 2004) 2189 2184 self.assertEqual(self.student['payments'][value].p_level, 300) 2190 2185 … … 2200 2195 # Current payment flag is set False 2201 2196 self.assertFalse(self.student['payments'][value].p_current) 2197 2198 # Button and form are not available for fresh students 2199 self.student['studycourse'].entry_session = 2004 2200 self.browser.open(self.payments_path) 2201 self.assertFalse( 2202 "Add previous session payment ticket" in self.browser.contents) 2203 self.browser.open(self.payments_path + '/addpp') 2204 self.assertTrue( 2205 "You can't pay for a session below your entry session" in 2206 self.browser.contents) 2202 2207 return 2203 2208 … … 2215 2220 IWorkflowState(self.student).setState('cleared') 2216 2221 self.browser.open(self.payments_path) 2217 self.browser.get Control("Add onlinepayment ticket").click()2222 self.browser.getLink("Add current session payment ticket").click() 2218 2223 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 2219 2224 self.browser.getControl("Create ticket").click() … … 2255 2260 # Remove first payment to be sure that we access the right ticket 2256 2261 del self.student['payments'][value] 2257 self.browser.get Control("Add onlinepayment ticket").click()2262 self.browser.getLink("Add current session payment ticket").click() 2258 2263 self.browser.getControl(name="form.p_category").value = ['schoolfee'] 2259 2264 self.browser.getControl("Create ticket").click() … … 2301 2306 # callback view (see test_manage_payments) 2302 2307 self.browser.getLink("Payments").click() 2303 self.browser.get Control("Add onlinepayment ticket").click()2308 self.browser.getLink("Add current session payment ticket").click() 2304 2309 self.browser.getControl(name="form.p_category").value = ['bed_allocation'] 2305 2310 self.browser.getControl("Create ticket").click()
Note: See TracChangeset for help on using the changeset viewer.