--- a/server/session.py Thu Apr 08 19:37:00 2010 +0200
+++ b/server/session.py Fri Apr 09 11:16:00 2010 +0200
@@ -946,6 +946,7 @@
class InternalSession(Session):
"""special session created internaly by the repository"""
is_internal_session = True
+ running_dbapi_query = False
def __init__(self, repo, cnxprops=None):
super(InternalSession, self).__init__(InternalManager(), repo, cnxprops,
--- a/server/test/unittest_session.py Thu Apr 08 19:37:00 2010 +0200
+++ b/server/test/unittest_session.py Fri Apr 09 11:16:00 2010 +0200
@@ -7,6 +7,7 @@
"""
from logilab.common.testlib import TestCase, unittest_main, mock_object
+from cubicweb.devtools.testlib import CubicWebTC
from cubicweb.server.session import _make_description
class Variable:
@@ -32,5 +33,10 @@
self.assertEquals(_make_description((Function('max', 'A'), Variable('B')), {}, solution),
['Int','CWUser'])
+class InternalSessionTC(CubicWebTC):
+ def test_dbapi_query(self):
+ session = self.repo.internal_session()
+ self.assertFalse(session.running_dbapi_query)
+
if __name__ == '__main__':
unittest_main()