# HG changeset patch # User Sylvain Thénault # Date 1268128790 -3600 # Node ID 3653e09024a1db44ed9f7dcf1f43152319417b34 # Parent 0b9a842ec4f728a7caf7713b6090e466e3c9b6e3 cleanup diff -r 0b9a842ec4f7 -r 3653e09024a1 server/session.py --- a/server/session.py Tue Mar 09 10:59:44 2010 +0100 +++ b/server/session.py Tue Mar 09 10:59:50 2010 +0100 @@ -233,9 +233,15 @@ self.set_language(value) def deleted_in_transaction(self, eid): + """return True if the entity of the given eid is being deleted in the + current transaction + """ return eid in self.transaction_data.get('pendingeids', ()) def added_in_transaction(self, eid): + """return True if the entity of the given eid is being created in the + current transaction + """ return eid in self.transaction_data.get('neweids', ()) def schema_rproperty(self, rtype, eidfrom, eidto, rprop): diff -r 0b9a842ec4f7 -r 3653e09024a1 sobjects/test/unittest_supervising.py --- a/sobjects/test/unittest_supervising.py Tue Mar 09 10:59:44 2010 +0100 +++ b/sobjects/test/unittest_supervising.py Tue Mar 09 10:59:50 2010 +0100 @@ -27,7 +27,6 @@ def test_supervision(self): - session = self.session # do some modification user = self.execute('INSERT CWUser X: X login "toto", X upassword "sosafe", X in_group G ' 'WHERE G name "users"').get_entity(0, 0) @@ -37,6 +36,7 @@ self.execute('SET X content "duh?" WHERE X is Comment') self.execute('DELETE X comments Y WHERE Y is Card, Y title "une autre news !"') # check only one supervision email operation + session = self.session sentops = [op for op in session.pending_operations if isinstance(op, SupervisionMailOp)] self.assertEquals(len(sentops), 1)