[repo] Drop repo.connect backward compat
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 10 Mar 2017 14:02:31 +0100
changeset 12030 72c3af2cde23
parent 12029 3d9883a6068f
child 12031 92da3e6cb104
[repo] Drop repo.connect backward compat use new_session instead (introduced in 3.19 iirc)
cubicweb/server/repository.py
cubicweb/server/test/unittest_repository.py
--- a/cubicweb/server/repository.py	Fri Mar 10 14:01:45 2017 +0100
+++ b/cubicweb/server/repository.py	Fri Mar 10 14:02:31 2017 +0100
@@ -663,10 +663,6 @@
             cnx.commit()
         return session
 
-    @deprecated('[3.23] use .new_session instead (and get a plain session object)')
-    def connect(self, login, **kwargs):
-        return self.new_session(login, **kwargs).sessionid
-
     # session handling ########################################################
 
     @contextmanager
--- a/cubicweb/server/test/unittest_repository.py	Fri Mar 10 14:01:45 2017 +0100
+++ b/cubicweb/server/test/unittest_repository.py	Fri Mar 10 14:02:31 2017 +0100
@@ -79,17 +79,17 @@
     def test_connect(self):
         self.assertTrue(self.repo.new_session(self.admlogin, password=self.admpassword))
         self.assertRaises(AuthenticationError,
-                          self.repo.connect, self.admlogin, password='nimportnawak')
+                          self.repo.new_session, self.admlogin, password='nimportnawak')
         self.assertRaises(AuthenticationError,
-                          self.repo.connect, self.admlogin, password='')
+                          self.repo.new_session, self.admlogin, password='')
         self.assertRaises(AuthenticationError,
-                          self.repo.connect, self.admlogin, password=None)
+                          self.repo.new_session, self.admlogin, password=None)
         self.assertRaises(AuthenticationError,
-                          self.repo.connect, None, password=None)
+                          self.repo.new_session, None, password=None)
         self.assertRaises(AuthenticationError,
-                          self.repo.connect, self.admlogin)
+                          self.repo.new_session, self.admlogin)
         self.assertRaises(AuthenticationError,
-                          self.repo.connect, None)
+                          self.repo.new_session, None)
 
     def test_login_upassword_accent(self):
         with self.admin_access.repo_cnx() as cnx: