web/test/unittest_application.py
changeset 9876 ff98039cb4cd
parent 9862 f97a65c29d82
child 9882 4db650d79e32
--- a/web/test/unittest_application.py	Fri Jul 04 14:30:16 2014 +0200
+++ b/web/test/unittest_application.py	Wed Jul 02 12:52:50 2014 +0200
@@ -19,6 +19,7 @@
 
 import base64, Cookie
 import httplib
+import tempfile
 
 from logilab.common.testlib import TestCase, unittest_main
 from logilab.common.decorators import clear_cache, classproperty
@@ -435,6 +436,14 @@
             req.form['rql'] = 'rql:Any OV1, X WHERE X custom_workflow OV1?'
             self.app_handle_request(req)
 
+    def test_log_queries(self):
+        logfile = tempfile.NamedTemporaryFile()
+        self.config.global_set_option('query-log-file', logfile.name)
+        with self.admin_access.web_request() as req:
+            self.app.handle_request(req, 'view')
+        self.assertTrue(logfile.read())
+        logfile.close()
+
 
 if __name__ == '__main__':
     unittest_main()