diff -r a5d7fcde74c9 -r f5f83d72ba8d cubicweb/devtools/testlib.py --- a/cubicweb/devtools/testlib.py Wed May 08 21:37:13 2019 +0200 +++ b/cubicweb/devtools/testlib.py Fri May 10 15:58:01 2019 +0200 @@ -446,10 +446,7 @@ reverse_primary_email=user) user.cw_clear_relation_cache('in_group', 'subject') if commit: - try: - req.commit() # req is a session - except AttributeError: - req.cnx.commit() + getattr(req, 'cnx', req).commit() return user # other utilities #########################################################