# HG changeset patch # User Sylvain Thénault # Date 1489165033 -3600 # Node ID e9682629df574f27f0780ad0cccc49698b9e4208 # Parent 7514626e1dc580deb80cf10ee7b5965e1c48ab9a [test] Use user_session_cache_key function to generate cache key. diff -r 7514626e1dc5 -r e9682629df57 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):