Index: main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
===================================================================
--- main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py	(revision 8473)
+++ main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py	(revision 8598)
@@ -30,5 +30,4 @@
 from waeup.uniben.students.batching import CustomStudentProcessor
 from waeup.uniben.testing import FunctionalLayer
-from waeup.uniben.students.utils import get_school_fee
 from waeup.uniben.students.interfaces import (
     ICustomStudentStudyCourse, ICustomStudent,
@@ -303,13 +302,5 @@
         return
 
-    def test_get_schoolfee(self):
-        self.assertEqual(get_school_fee(self.student),0.0)
-        IWorkflowState(self.student).setState('cleared')
-        self.assertEqual(get_school_fee(self.student),40000.0)
-        IWorkflowState(self.student).setState('returning')
-        self.assertEqual(get_school_fee(self.student),20000.0)
-        return
-
-    def test_get_payment_details(self):
+    def test_set_payment_details(self):
         self.app['configuration']['2004'].gown_fee = 150.0
         self.app['configuration']['2004'].transfer_fee = 90.0
@@ -317,27 +308,58 @@
         self.app['configuration']['2004'].maint_fee = 180.0
         utils = getUtility(IStudentsUtils)
-        self.assertEqual(utils.getPaymentDetails('schoolfee',self.student),
-            {'p_level': 100, 'p_session': 2004, 'amount': 0.0,
-            'p_item': u'CERT1', 'error': u'Amount could not be determined.'}
-            )
-        self.assertEqual(utils.getPaymentDetails('clearance',self.student),
-            {'p_level': 100, 'p_session': 2004, 'amount': 34250.0,
-            'p_item': u'CERT1', 'error': u''}
-            )
-        self.assertEqual(utils.getPaymentDetails('gown',self.student),
-            {'p_level': 100, 'p_session': 2004, 'amount': 150.0,
-            'p_item': u'', 'error': u''}
-            )
-        self.assertEqual(utils.getPaymentDetails('hostel_maintenance',self.student),
-            {'p_level': 100, 'p_session': 2004, 'amount': 180.0,
-            'p_item': u'', 'error': u''}
-            )
-        self.assertEqual(utils.getPaymentDetails('bed_allocation',self.student),
-            {'p_level': 100, 'p_session': 2004, 'amount': 150.0,
-            'p_item': u'', 'error': u''}
-            )
-        self.assertEqual(utils.getPaymentDetails('transfer',self.student),
-            {'p_level': 100, 'p_session': 2004, 'amount': 90.0,
-            'p_item': u'', 'error': u''}
-            )
+
+        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)
+
+        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, 20000.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
