sobjects/test/unittest_email.py
branchstable
changeset 4673 6f8b925a29f4
parent 4252 6c4f109c2b03
child 5421 8167de96c523
equal deleted inserted replaced
4672:0288f8e5460c 4673:6f8b925a29f4
    44         self.create_user('toto')
    44         self.create_user('toto')
    45         email1 = self.execute('INSERT EmailAddress E: E address "client@client.com", U use_email E WHERE U login "admin"')[0][0]
    45         email1 = self.execute('INSERT EmailAddress E: E address "client@client.com", U use_email E WHERE U login "admin"')[0][0]
    46         self.commit()
    46         self.commit()
    47         cnx = self.login('toto')
    47         cnx = self.login('toto')
    48         cu = cnx.cursor()
    48         cu = cnx.cursor()
    49         cu.execute('SET U primary_email E WHERE E eid %(e)s, U login "toto"',
    49         self.assertRaises(Unauthorized,
    50                    {'e': email1})
    50                           cu.execute, 'SET U primary_email E WHERE E eid %(e)s, U login "toto"',
    51         self.assertRaises(Unauthorized, cnx.commit)
    51                           {'e': email1})
    52 
    52         cnx.close()
    53 
    53 
    54 if __name__ == '__main__':
    54 if __name__ == '__main__':
    55     from logilab.common.testlib import unittest_main
    55     from logilab.common.testlib import unittest_main
    56     unittest_main()
    56     unittest_main()