equal
deleted
inserted
replaced
21 from cubicweb.devtools.testlib import CubicWebTC |
21 from cubicweb.devtools.testlib import CubicWebTC |
22 from cubicweb.transaction import * |
22 from cubicweb.transaction import * |
23 |
23 |
24 class UndoableTransactionTC(CubicWebTC): |
24 class UndoableTransactionTC(CubicWebTC): |
25 |
25 |
|
26 |
26 def setup_database(self): |
27 def setup_database(self): |
|
28 req = self.request() |
27 self.session.undo_actions = set('CUDAR') |
29 self.session.undo_actions = set('CUDAR') |
28 self.toto = self.create_user('toto', password='toto', groups=('users',), |
30 self.toto = self.create_user(req, 'toto', password='toto', groups=('users',), |
29 commit=False) |
31 commit=False) |
30 self.txuuid = self.commit() |
32 self.txuuid = self.commit() |
31 |
33 |
32 def tearDown(self): |
34 def tearDown(self): |
33 self.restore_connection() |
35 self.restore_connection() |
244 self.check_transaction_deleted(txuuid) |
246 self.check_transaction_deleted(txuuid) |
245 |
247 |
246 |
248 |
247 def test_undo_creation_integrity_1(self): |
249 def test_undo_creation_integrity_1(self): |
248 session = self.session |
250 session = self.session |
249 tutu = self.create_user('tutu', commit=False) |
251 req = self.request() |
|
252 tutu = self.create_user(req, 'tutu', commit=False) |
250 txuuid = self.commit() |
253 txuuid = self.commit() |
251 email = self.request().create_entity('EmailAddress', address=u'tutu@cubicweb.org') |
254 email = self.request().create_entity('EmailAddress', address=u'tutu@cubicweb.org') |
252 prop = self.request().create_entity('CWProperty', pkey=u'ui.default-text-format', |
255 prop = self.request().create_entity('CWProperty', pkey=u'ui.default-text-format', |
253 value=u'text/html') |
256 value=u'text/html') |
254 tutu.set_relations(use_email=email, reverse_for_user=prop) |
257 tutu.set_relations(use_email=email, reverse_for_user=prop) |