server/test/unittest_ldapuser.py
branch3.5
changeset 2920 64322aa83a1d
parent 1977 606923dff11b
child 2968 0e3460341023
child 3587 5b3725f315fc
--- a/server/test/unittest_ldapuser.py	Thu Aug 20 17:33:05 2009 +0200
+++ b/server/test/unittest_ldapuser.py	Thu Aug 20 17:44:27 2009 +0200
@@ -156,7 +156,8 @@
         self.patch_authenticate()
         cnx = self.login('syt', 'dummypassword')
         cu = cnx.cursor()
-        cu.execute('SET X in_state S WHERE X login "alf", S name "deactivated"')
+        alf = cu.execute('Any X WHERE X login "alf"').get_entity(0, 0)
+        alf.fire_transition('deactivate')
         try:
             cnx.commit()
             alf = self.execute('CWUser X WHERE X login "alf"').get_entity(0, 0)
@@ -172,7 +173,8 @@
         finally:
             # restore db state
             self.restore_connection()
-            self.execute('SET X in_state S WHERE X login "alf", S name "activated"')
+            alf = self.execute('Any X WHERE X login "alf"').get_entity(0, 0)
+            alf.fire_transition('activate')
             self.execute('DELETE X in_group G WHERE X login "syt", G name "managers"')
 
     def test_same_column_names(self):