[test] Use user_session_cache_key function
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 10 Mar 2017 17:57:13 +0100
changeset 12040 e9682629df57
parent 12039 7514626e1dc5
child 12041 69f69ce8241a
[test] Use user_session_cache_key function to generate cache key.
cubicweb/devtools/repotest.py
--- a/cubicweb/devtools/repotest.py	Fri Mar 10 17:52:44 2017 +0100
+++ b/cubicweb/devtools/repotest.py	Fri Mar 10 17:57:13 2017 +0100
@@ -27,7 +27,7 @@
 from logilab.common.testlib import SkipTest
 
 from cubicweb.devtools.testlib import RepoAccess
-
+from cubicweb.entities.authobjs import user_session_cache_key
 
 def tuplify(mylist):
     return [tuple(item) for item in mylist]
@@ -251,7 +251,7 @@
         # use cnx.user.eid to get correct owned_by relation, unless explicit eid
         with self._access.cnx() as cnx:
             user_eid = cnx.user.eid
-            cnx.user._cw.data['groups-%s' % user_eid] = set(groups)
+            cnx.user._cw.data[user_session_cache_key(user_eid, 'groups')] = set(groups)
             yield cnx
 
     def qexecute(self, rql, args=None, build_descr=True):