Index: /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py
===================================================================
--- /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py	(revision 13385)
+++ /main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/tests.py	(revision 13386)
@@ -24,5 +24,22 @@
 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup
 from waeup.kofa.configuration import SessionConfiguration
+from waeup.kofa.students.payments import StudentOnlinePayment
+from kofacustom.nigeria.interswitch.helpers import query_interswitch
 from kofacustom.nigeria.testing import FunctionalLayer
+
+# Also run tests that send requests to external servers?
+#   If you enable this, please make sure the external services
+#   do exist really and are not bothered by being spammed by a test programme.
+EXTERNAL_TESTS = True
+
+def external_test(func):
+    if not EXTERNAL_TESTS:
+        myself = __file__
+        if myself.endswith('.pyc'):
+            myself = myself[:-2]
+        print "WARNING: external tests are skipped!"
+        print "WARNING: edit %s to enable them." % myself
+        return
+    return func
 
 class InterswitchTestsStudents(StudentsFullSetup):
@@ -48,7 +65,5 @@
         self.assertMatches('...Amount Authorized...',
                            self.browser.contents)
-        self.assertMatches(
-            '...<span>40000.0</span>...',
-            self.browser.contents)
+        self.assertTrue('<span>40000.0</span>', self.browser.contents)
         self.payment_url = self.browser.url
         self.payment = self.student['payments'][self.value]
@@ -119,4 +134,21 @@
         self.assertMatches('...Total Amount Authorized:...',
                            self.browser.contents)
+
+    @external_test
+    def test_query_interswitch(self):
+        host = 'webpay.interswitchng.com'
+        url = '/paydirect/services/TransactionQueryWs.asmx'
+        https = True
+        product_id = '5845' # AAUE regular
+        payment = StudentOnlinePayment()
+        payment.p_id ='p4465649308559'
+        payment.amount_auth = 60250.0
+        success, msg, log = query_interswitch(
+            payment, product_id, host, url, https)
+        self.assertEqual('Successful callback received', msg)
+        self.assertTrue(success)
+        self.assertTrue(
+            '00:Approved Successful:6025000:3154:p4465649308559:'
+            'ZIB|WEB|ABAL|3-11-2015|021336:000457580882' in log)
 
 class InterswitchTestsApplicants(ApplicantsFullSetup):
