equal
deleted
inserted
replaced
69 ease the transition. |
69 ease the transition. |
70 |
70 |
71 The authentification stack have been altered to use the ``repoapi`` instead of |
71 The authentification stack have been altered to use the ``repoapi`` instead of |
72 the ``dbapi``. Cubes adding new element in this stack are likely to break. |
72 the ``dbapi``. Cubes adding new element in this stack are likely to break. |
73 |
73 |
|
74 New API in test |
|
75 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
76 |
|
77 All current methods and attributes used to access the repo on ``CubicwebTC`` are |
|
78 deprecated. You can now use a ``RepoAccess`` object. A ``RepoAccess`` object is |
|
79 linked to a new ``Session`` for a specified user. It is able to create |
|
80 ``Connection``, ``ClientConnection`` and web side request linked to this |
|
81 session:: |
|
82 |
|
83 access =self.new_access("babar") # create a new RepoAccess for user babar |
|
84 with access.repo_cnx() as cnx: |
|
85 # some work with server side cnx |
|
86 cnx.execute(…) |
|
87 cnx.commit() |
|
88 cnx.execute(…) |
|
89 cnx.commit() |
|
90 |
|
91 with access.client_cnx() as cnx: |
|
92 # some work with client side cnx |
|
93 cnx.execute(…) |
|
94 cnx.commit() |
|
95 |
|
96 with access.web_request(elephant="babar") as req: |
|
97 # some work with client side cnx |
|
98 elephant_name = req.form["elephant"] |
|
99 req.execute(…) |
|
100 req.cnx.commit() |
|
101 |
|
102 By default ``testcase.admin_access`` contains a ``RepoAccess`` object for the |
|
103 default admin session. |
|
104 |
74 |
105 |
75 API changes |
106 API changes |
76 ----------- |
107 ----------- |
77 |
108 |
78 * ``RepositorySessionManager.postlogin`` is now called with two arguments, |
109 * ``RepositorySessionManager.postlogin`` is now called with two arguments, |