Select a user which is to be used by the HTTP request following this call.
(self, user_db)
| 163 | cls.app = TestApp(cls.app_module.setup_app()) |
| 164 | |
| 165 | def use_user(self, user_db): |
| 166 | """ |
| 167 | Select a user which is to be used by the HTTP request following this call. |
| 168 | """ |
| 169 | if not user_db: |
| 170 | raise ValueError('"user_db" is mandatory') |
| 171 | |
| 172 | mock_context = { |
| 173 | "user": user_db, |
| 174 | "auth_info": {"method": "authentication token", "location": "header"}, |
| 175 | } |
| 176 | self.request_context_mock = mock.PropertyMock(return_value=mock_context) |
| 177 | Router.mock_context = self.request_context_mock |
| 178 | |
| 179 | |
| 180 | class FunctionalTest(BaseFunctionalTest): |
no outgoing calls