diff -r 1b7b4709c0cf -r 52af67a2f0a5 web/test/unittest_views_basecontrollers.py --- a/web/test/unittest_views_basecontrollers.py Wed Mar 27 11:42:13 2013 +0100 +++ b/web/test/unittest_views_basecontrollers.py Wed Mar 27 17:09:55 2013 +0100 @@ -32,6 +32,8 @@ from cubicweb.utils import json_dumps from cubicweb.uilib import rql_for_eid from cubicweb.web import INTERNAL_FIELD_VALUE, Redirect, RequestError, RemoteCallFailed +import cubicweb.server.session +from cubicweb.server.session import Transaction as OldTransaction from cubicweb.entities.authobjs import CWUser from cubicweb.web.views.autoform import get_pending_inserts, get_pending_deletes from cubicweb.web.views.basecontrollers import JSonController, xhtmlize, jsonize @@ -781,9 +783,20 @@ class UndoControllerTC(CubicWebTC): + def setUp(self): + class Transaction(OldTransaction): + """Force undo feature to be turned on in all case""" + undo_actions = property(lambda tx: True, lambda x, y:None) + cubicweb.server.session.Transaction = Transaction + super(UndoControllerTC, self).setUp() + + def tearDown(self): + super(UndoControllerTC, self).tearDown() + cubicweb.server.session.Transaction = OldTransaction + + def setup_database(self): req = self.request() - self.session.undo_actions = True self.toto = self.create_user(req, 'toto', password='toto', groups=('users',), commit=False) self.txuuid_toto = self.commit()