cubicweb/devtools/repotest.py
branch3.25
changeset 12125 1d3a9bb46339
parent 12060 0cdf5fafd234
child 12235 03b94c9863de
equal deleted inserted replaced
12124:392d6d599286 12125:1d3a9bb46339
   249     def user_groups_session(self, *groups):
   249     def user_groups_session(self, *groups):
   250         """lightweight session using the current user with hi-jacked groups"""
   250         """lightweight session using the current user with hi-jacked groups"""
   251         # use cnx.user.eid to get correct owned_by relation, unless explicit eid
   251         # use cnx.user.eid to get correct owned_by relation, unless explicit eid
   252         with self.admin_access.cnx() as cnx:
   252         with self.admin_access.cnx() as cnx:
   253             user_eid = cnx.user.eid
   253             user_eid = cnx.user.eid
   254             cnx.user._cw.data[user_session_cache_key(user_eid, 'groups')] = set(groups)
   254             cnx.user._cw.transaction_data[user_session_cache_key(user_eid, 'groups')] = set(groups)
   255             yield cnx
   255             yield cnx
   256 
   256 
   257     def qexecute(self, rql, args=None, build_descr=True):
   257     def qexecute(self, rql, args=None, build_descr=True):
   258         with self.admin_access.cnx() as cnx:
   258         with self.admin_access.cnx() as cnx:
   259             try:
   259             try: