{"action":"created","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/12237","repository_url":"https://api.github.com/repos/odoo/odoo","labels_url":"https://api.github.com/repos/odoo/odoo/issues/12237/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/12237/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/12237/events","html_url":"https://github.com/odoo/odoo/issues/12237","id":157614789,"number":12237,"title":"HttpCase test cursor is not shared with the created session's test","user":{"login":"Yajo","id":973709,"avatar_url":"https://avatars.githubusercontent.com/u/973709?v=3","gravatar_id":"","url":"https://api.github.com/users/Yajo","html_url":"https://github.com/Yajo","followers_url":"https://api.github.com/users/Yajo/followers","following_url":"https://api.github.com/users/Yajo/following{/other_user}","gists_url":"https://api.github.com/users/Yajo/gists{/gist_id}","starred_url":"https://api.github.com/users/Yajo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yajo/subscriptions","organizations_url":"https://api.github.com/users/Yajo/orgs","repos_url":"https://api.github.com/users/Yajo/repos","events_url":"https://api.github.com/users/Yajo/events{/privacy}","received_events_url":"https://api.github.com/users/Yajo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-05-31T08:19:22Z","updated_at":"2016-08-11T14:04:55Z","closed_at":"2016-07-28T15:06:50Z","body":"Impacted versions: 9.0\r\n\r\nSteps to reproduce:\r\n\r\nCreate this test for `auth_signup` module:\r\n\r\n```\r\nfrom lxml.html import document_fromstring\r\nfrom openerp.tests.common import HttpCase\r\nclass UICase(HttpCase):\r\n    def setUp(self):\r\n        super(UICase, self).setUp()\r\n        self.icp = self.env[\"ir.config_parameter\"]\r\n        self.icp.set_param(\"auth_signup.allow_uninvited\", \"True\")\r\n\r\n    def tests_url_open(self):\r\n        doc = document_fromstring(self.url_open(\"/web/signup\").read())\r\n        self.assertEqual(\r\n            len(doc.xpath(\"//title[contains('404 Not Found')]\")), 0)\r\n ```\r\n\r\nRun the test.\r\n\r\nCurrent behavior: Test fails because the cursor is not the same in the running test and in the request that gets opened with `self.url_open`, and thus `auth_signup.allow_uninvited` still remains `False` and the `/web/signup` controller raises a 404 error.\r\n\r\nExpected behavior: The cursor for a test case should be the same, no matter if it opens sub-requests. It could be appended to the underlying `self.session`.\r\n\r\nWorkaround: commit at `setUp`, and manually undo your changes and commit at `tearDown`. But this is ugly and error-prone: **tests should never commit.**"},"comment":{"url":"https://api.github.com/repos/odoo/odoo/issues/comments/239170537","html_url":"https://github.com/odoo/odoo/issues/12237#issuecomment-239170537","issue_url":"https://api.github.com/repos/odoo/odoo/issues/12237","id":239170537,"user":{"login":"Yajo","id":973709,"avatar_url":"https://avatars.githubusercontent.com/u/973709?v=3","gravatar_id":"","url":"https://api.github.com/users/Yajo","html_url":"https://github.com/Yajo","followers_url":"https://api.github.com/users/Yajo/followers","following_url":"https://api.github.com/users/Yajo/following{/other_user}","gists_url":"https://api.github.com/users/Yajo/gists{/gist_id}","starred_url":"https://api.github.com/users/Yajo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yajo/subscriptions","organizations_url":"https://api.github.com/users/Yajo/orgs","repos_url":"https://api.github.com/users/Yajo/repos","events_url":"https://api.github.com/users/Yajo/events{/privacy}","received_events_url":"https://api.github.com/users/Yajo/received_events","type":"User","site_admin":false},"created_at":"2016-08-11T14:04:54Z","updated_at":"2016-08-11T14:04:54Z","body":"Thanks, it's in https://github.com/OCA/website/pull/211/commits/8a85e3e737ddc999c1d090cb9ac22f612a86fbaa (remember you'll have to merge https://github.com/OCA/website/pull/202 too to make this module work).\r\n\r\nSince I cannot make it work after trying some workarounds, I changed it to what I think it *should* be if this bug never existed. Please give me advice, thanks."}}
{"actor":{"display_login":"Yajo"}}