devtools/testlib.py
changeset 5557 1a534c596bff
parent 5426 0d4853a6e5ee
child 5752 b0bb553e3be4
equal deleted inserted replaced
5556:9ab2b4c74baf 5557:1a534c596bff
   304         user = req.create_entity('CWUser', login=unicode(login),
   304         user = req.create_entity('CWUser', login=unicode(login),
   305                                  upassword=password, **kwargs)
   305                                  upassword=password, **kwargs)
   306         req.execute('SET X in_group G WHERE X eid %%(x)s, G name IN(%s)'
   306         req.execute('SET X in_group G WHERE X eid %%(x)s, G name IN(%s)'
   307                     % ','.join(repr(g) for g in groups),
   307                     % ','.join(repr(g) for g in groups),
   308                     {'x': user.eid})
   308                     {'x': user.eid})
   309         user.clear_related_cache('in_group', 'subject')
   309         user.cw_clear_relation_cache('in_group', 'subject')
   310         if commit:
   310         if commit:
   311             req.cnx.commit()
   311             req.cnx.commit()
   312         return user
   312         return user
   313 
   313 
   314     def login(self, login, **kwargs):
   314     def login(self, login, **kwargs):