Index: main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/students/tests/test_utils.py
===================================================================
--- main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/students/tests/test_utils.py	(revision 14336)
+++ main/kofacustom.coewarri/trunk/src/kofacustom/coewarri/students/tests/test_utils.py	(revision 14336)
@@ -0,0 +1,49 @@
+# -*- coding: utf-8 -*-
+from hurry.workflow.interfaces import IWorkflowState
+from zope.component import getUtility, createObject
+from waeup.kofa.testing import FunctionalTestCase
+from waeup.kofa.university.faculty import Faculty
+from waeup.kofa.university.department import Department
+from waeup.kofa.students.student import Student
+from waeup.kofa.students.interfaces import IStudentsUtils
+from waeup.kofa.students.tests.test_browser import StudentsFullSetup
+from kofacustom.coewarri.testing import FunctionalLayer
+
+class StudentsUtilsTests(StudentsFullSetup):
+
+    layer = FunctionalLayer
+
+    def test_set_payment_details(self):
+        self.student['studycourse'].certificate.study_mode = 'ug_ft'
+        self.student.nationality = u'NG'
+        self.student.lga = 'ebonyi_ukaba'
+        self.student['studycourse'].current_session = 2016
+        self.student['studycourse'].entry_session = 2016
+        utils = getUtility(IStudentsUtils)
+
+        configuration = createObject('waeup.SessionConfiguration')
+        configuration.academic_session = 2016
+        self.app['configuration'].addSessionConfiguration(configuration)
+        self.app['configuration']['2016'].clearance_fee = 10234.0
+
+        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, 2016)
+        self.assertEqual(payment.amount_auth, 79500.0)
+        self.assertEqual(payment.p_item, u'CERT1')
+        self.assertEqual(error, None)
+
+        error, payment = utils.setPaymentDetails('clearance',self.student)
+        self.assertEqual(payment.amount_auth, 15234.0)
+        self.assertEqual(payment.p_item, u'CERT1')
+
+        self.student.lga = 'delta_burutu'
+        error, payment = utils.setPaymentDetails('schoolfee',self.student)
+        self.assertEqual(payment.amount_auth, 69500.0)
+        error, payment = utils.setPaymentDetails('clearance',self.student)
+        self.assertEqual(payment.amount_auth, 10234.0)
+        return
