# HG changeset patch # User Sylvain Thénault # Date 1489165105 -3600 # Node ID 69f69ce8241ab4b613bfd15341c9c14423ad6849 # Parent e9682629df574f27f0780ad0cccc49698b9e4208 [user] Drop ugly hack on CWUser entity class which should be not necessary anymore, beside two remaining usage in our own test suite. diff -r e9682629df57 -r 69f69ce8241a cubicweb/entities/authobjs.py --- a/cubicweb/entities/authobjs.py Fri Mar 10 17:57:13 2017 +0100 +++ b/cubicweb/entities/authobjs.py Fri Mar 10 17:58:25 2017 +0100 @@ -173,14 +173,3 @@ return self.login dc_long_title = name - - def __call__(self, *args, **kwargs): - """ugly hack for compatibility betweeb dbapi and repo api - - In the dbapi, Connection and Session have a ``user`` method to - generated a user for a request In the repo api, Connection and Session - have a user attribute inherited from SessionRequestBase prototype. This - ugly hack allows to not break user of the user method. - - XXX Deprecate me ASAP""" - return self diff -r e9682629df57 -r 69f69ce8241a cubicweb/server/test/unittest_querier.py --- a/cubicweb/server/test/unittest_querier.py Fri Mar 10 17:57:13 2017 +0100 +++ b/cubicweb/server/test/unittest_querier.py Fri Mar 10 17:58:25 2017 +0100 @@ -1146,7 +1146,7 @@ self.assertRaises(QueryError, self.qexecute, - "INSERT CWUser X: X login 'toto', X eid %s" % cnx.user(self.session).eid) + "INSERT CWUser X: X login 'toto', X eid %s" % cnx.user.eid) def test_insertion_description_with_where(self): rset = self.qexecute('INSERT CWUser E, EmailAddress EM: E login "X", E upassword "X", ' @@ -1338,7 +1338,7 @@ "WHERE X is Personne") self.assertRaises(QueryError, self.qexecute, - "SET X login 'tutu', X eid %s" % cnx.user(self.session).eid) + "SET X login 'tutu', X eid %s" % cnx.user.eid) # HAVING on write queries test #############################################