sobjects/test/unittest_supervising.py
changeset 9548 be001628edad
parent 8731 93c0c31875ac
child 9743 2bd234de9ff3
equal deleted inserted replaced
9547:43aace16a953 9548:be001628edad
     1 # -*- coding: iso-8859-1 -*-
     1 # -*- coding: iso-8859-1 -*-
     2 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     3 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     4 #
     4 #
     5 # This file is part of CubicWeb.
     5 # This file is part of CubicWeb.
     6 #
     6 #
     7 # CubicWeb is free software: you can redistribute it and/or modify it under the
     7 # CubicWeb is free software: you can redistribute it and/or modify it under the
    45                             'WHERE G name "users"').get_entity(0, 0)
    45                             'WHERE G name "users"').get_entity(0, 0)
    46         self.execute('SET X last_login_time NOW WHERE X eid %(x)s', {'x': user.eid})
    46         self.execute('SET X last_login_time NOW WHERE X eid %(x)s', {'x': user.eid})
    47         self.execute('DELETE Card B WHERE B title "une news !"')
    47         self.execute('DELETE Card B WHERE B title "une news !"')
    48         self.execute('SET X bookmarked_by U WHERE X is Bookmark, U eid %(x)s', {'x': user.eid})
    48         self.execute('SET X bookmarked_by U WHERE X is Bookmark, U eid %(x)s', {'x': user.eid})
    49         self.execute('SET X content "duh?" WHERE X is Comment')
    49         self.execute('SET X content "duh?" WHERE X is Comment')
    50         self.execute('DELETE X comments Y WHERE Y is Card, Y title "une autre news !"')
    50         self.execute('DELETE Comment C WHERE C comments Y, Y is Card, Y title "une autre news !"')
    51         # check only one supervision email operation
    51         # check only one supervision email operation
    52         session = self.session
    52         session = self.session
    53         sentops = [op for op in session.pending_operations
    53         sentops = [op for op in session.pending_operations
    54                    if isinstance(op, SupervisionMailOp)]
    54                    if isinstance(op, SupervisionMailOp)]
    55         self.assertEqual(len(sentops), 1)
    55         self.assertEqual(len(sentops), 1)
    73 * added relation bookmarked_by from bookmark #EID to cwuser #EID
    73 * added relation bookmarked_by from bookmark #EID to cwuser #EID
    74 
    74 
    75 * updated comment #EID (duh?)
    75 * updated comment #EID (duh?)
    76   http://testing.fr/cubicweb/comment/EID
    76   http://testing.fr/cubicweb/comment/EID
    77 
    77 
    78 * deleted relation comments from comment #EID to card #EID''',
    78 * deleted comment #EID (duh?)''',
    79                               data)
    79                               data)
    80         # check prepared email
    80         # check prepared email
    81         op._prepare_email()
    81         op._prepare_email()
    82         self.assertEqual(len(op.to_send), 1)
    82         self.assertEqual(len(op.to_send), 1)
    83         self.assert_(op.to_send[0][0])
    83         self.assert_(op.to_send[0][0])