Index: main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py
===================================================================
--- main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py	(revision 8981)
+++ main/waeup.futminna/trunk/src/waeup/futminna/students/tests/test_browser.py	(revision 9155)
@@ -70,114 +70,4 @@
     layer = FunctionalLayer
 
-    def test_manage_payments(self):
-        # Add missing configuration data
-        self.app['configuration']['2004'].gown_fee = 150.0
-        self.app['configuration']['2004'].transfer_fee = 90.0
-        #self.app['configuration']['2004'].clearance_fee = 120.0
-        self.app['configuration']['2004'].booking_fee = 150.0
-        self.app['configuration']['2004'].maint_fee = 180.0
-
-        # Managers can add online payment tickets
-        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
-        self.browser.open(self.payments_path)
-        self.browser.getControl("Add online payment ticket").click()
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...Amount could not be determined...',
-                           self.browser.contents)
-        IWorkflowState(self.student).setState('cleared')
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
-        ctrl = self.browser.getControl(name='val_id')
-        value = ctrl.options[0]
-        self.browser.getLink(value).click()
-        self.assertMatches('...Amount Authorized...',
-                           self.browser.contents)
-        # Managers can open payment slip
-        self.browser.getLink("Download payment slip").click()
-        self.assertEqual(self.browser.headers['Status'], '200 Ok')
-        self.assertEqual(self.browser.headers['Content-Type'], 'application/pdf')
-        # Set ticket paid
-        ticket = self.student['payments'].items()[0][1]
-        ticket.p_state = 'paid'
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...This type of payment has already been made...',
-                           self.browser.contents)
-        # Remove all payments so that we can add a school fee payment again
-        keys = [i for i in self.student['payments'].keys()]
-        for payment in keys:
-            del self.student['payments'][payment]
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(name="form.p_category").value = ['gown']
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(name="form.p_category").value = ['transfer']
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(
-            name="form.p_category").value = ['bed_allocation']
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(
-            name="form.p_category").value = ['hostel_maintenance']
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(name="form.p_category").value = ['clearance']
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(name="form.p_category").value = ['schoolfee']
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
-        # In state returning we can add a new school fee ticket since
-        # p_session and p_level is different
-        IWorkflowState(self.student).setState('returning')
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(name="form.p_category").value = ['schoolfee']
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...Session configuration object is not...',
-                           self.browser.contents)
-        # Uups, we forgot to add a session configuration for next session
-        configuration = createObject('waeup.SessionConfiguration')
-        configuration.academic_session = 2005
-        self.app['configuration'].addSessionConfiguration(configuration)
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(name="form.p_category").value = ['schoolfee']
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...ticket created...',
-                           self.browser.contents)
-        # In state admitted school fee can't be determined
-        IWorkflowState(self.student).setState('admitted')
-        self.browser.open(self.payments_path + '/addop')
-        self.browser.getControl(name="form.p_category").value = ['schoolfee']
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...Amount could not be determined...',
-                           self.browser.contents)
-
-        # If the session configuration doesn't exist an error message will
-        # be shown. No other requirement is being checked.
-        del self.app['configuration']['2004']
-        self.browser.open(self.payments_path)
-        self.browser.getControl("Add online payment ticket").click()
-        self.browser.getControl("Create ticket").click()
-        self.assertMatches('...Session configuration object is not...',
-                           self.browser.contents)
-
     def test_get_returning_data(self):
         # Student is in level 100, session 2004 with verdict A
@@ -189,77 +79,2 @@
         self.assertEqual(utils.getReturningData(self.student),(2005, 100))
         return
-
-    def test_set_payment_details(self):
-        self.app['configuration']['2004'].gown_fee = 150.0
-        self.app['configuration']['2004'].transfer_fee = 90.0
-        self.app['configuration']['2004'].booking_fee = 150.0
-        self.app['configuration']['2004'].maint_fee = 180.0
-        utils = getUtility(IStudentsUtils)
-
-        configuration = createObject('waeup.SessionConfiguration')
-        configuration.academic_session = 2005
-        self.app['configuration'].addSessionConfiguration(configuration)
-
-        error, payment = utils.setPaymentDetails('schoolfee',self.student)
-        self.assertEqual(payment, None)
-        self.assertEqual(error, u'Amount could not be determined.')
-
-        IWorkflowState(self.student).setState('cleared')
-        error, payment = utils.setPaymentDetails('schoolfee',self.student)
-        self.assertEqual(payment.p_level, 100)
-        self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 40000.0)
-        self.assertEqual(payment.p_item, u'CERT1')
-        self.assertEqual(error, None)
-
-        # Add penalty fee ...
-        # ... for cleared
-        self.app['configuration']['2004'].penalty_ug = 99.0
-        # ... for returning
-        self.app['configuration']['2005'].penalty_ug = 88.0
-        error, payment = utils.setPaymentDetails('schoolfee',self.student)
-        self.assertEqual(payment.amount_auth, 40099.0)
-
-        IWorkflowState(self.student).setState('returning')
-        error, payment = utils.setPaymentDetails('schoolfee',self.student)
-        self.assertEqual(payment.p_level, 200)
-        self.assertEqual(payment.p_session, 2005)
-        self.assertEqual(payment.amount_auth, 20088.0)
-        self.assertEqual(payment.p_item, u'CERT1')
-        self.assertEqual(error, None)
-
-        error, payment = utils.setPaymentDetails('clearance',self.student)
-        self.assertEqual(payment.p_level, 100)
-        self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 34250.0)
-        self.assertEqual(payment.p_item, u'CERT1')
-        self.assertEqual(error, None)
-
-        error, payment = utils.setPaymentDetails('gown',self.student)
-        self.assertEqual(payment.p_level, 100)
-        self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 150.0)
-        self.assertEqual(payment.p_item, u'')
-        self.assertEqual(error, None)
-
-        error, payment = utils.setPaymentDetails('hostel_maintenance',self.student)
-        self.assertEqual(payment.p_level, 100)
-        self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 180.0)
-        self.assertEqual(payment.p_item, u'')
-        self.assertEqual(error, None)
-
-        error, payment = utils.setPaymentDetails('bed_allocation',self.student)
-        self.assertEqual(payment.p_level, 100)
-        self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 150.0)
-        self.assertEqual(payment.p_item, u'')
-        self.assertEqual(error, None)
-
-        error, payment = utils.setPaymentDetails('transfer',self.student)
-        self.assertEqual(payment.p_level, 100)
-        self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 90.0)
-        self.assertEqual(payment.p_item, u'')
-        self.assertEqual(error, None)
-        return
