sobjects/test/unittest_email.py
branchstable
changeset 4673 6f8b925a29f4
parent 4252 6c4f109c2b03
child 5421 8167de96c523
--- a/sobjects/test/unittest_email.py	Tue Feb 23 20:22:40 2010 +0100
+++ b/sobjects/test/unittest_email.py	Tue Feb 23 20:23:46 2010 +0100
@@ -46,10 +46,10 @@
         self.commit()
         cnx = self.login('toto')
         cu = cnx.cursor()
-        cu.execute('SET U primary_email E WHERE E eid %(e)s, U login "toto"',
-                   {'e': email1})
-        self.assertRaises(Unauthorized, cnx.commit)
-
+        self.assertRaises(Unauthorized,
+                          cu.execute, 'SET U primary_email E WHERE E eid %(e)s, U login "toto"',
+                          {'e': email1})
+        cnx.close()
 
 if __name__ == '__main__':
     from logilab.common.testlib import unittest_main