{"action":"closed","issue":{"url":"https://api.github.com/repos/onesteinbv/addons-onestein/issues/50","repository_url":"https://api.github.com/repos/onesteinbv/addons-onestein","labels_url":"https://api.github.com/repos/onesteinbv/addons-onestein/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/onesteinbv/addons-onestein/issues/50/comments","events_url":"https://api.github.com/repos/onesteinbv/addons-onestein/issues/50/events","html_url":"https://github.com/onesteinbv/addons-onestein/issues/50","id":326947678,"number":50,"title":"Failing odoo.sh tests, need to change test class","user":{"login":"eimantasnejus","id":4450686,"avatar_url":"https://avatars3.githubusercontent.com/u/4450686?v=4","gravatar_id":"","url":"https://api.github.com/users/eimantasnejus","html_url":"https://github.com/eimantasnejus","followers_url":"https://api.github.com/users/eimantasnejus/followers","following_url":"https://api.github.com/users/eimantasnejus/following{/other_user}","gists_url":"https://api.github.com/users/eimantasnejus/gists{/gist_id}","starred_url":"https://api.github.com/users/eimantasnejus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eimantasnejus/subscriptions","organizations_url":"https://api.github.com/users/eimantasnejus/orgs","repos_url":"https://api.github.com/users/eimantasnejus/repos","events_url":"https://api.github.com/users/eimantasnejus/events{/privacy}","received_events_url":"https://api.github.com/users/eimantasnejus/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-28T08:48:06Z","updated_at":"2018-05-28T11:16:11Z","closed_at":"2018-05-28T11:16:11Z","author_association":"NONE","body":"Hi, we are pleased with `account_cost_center` module's functionality, however we use odoo.sh extensively and the way that module's unit tests are written currently causes it to fail. It happens, because every instance of odoo.sh is loaded instantly with all related modules, and modules, dealing with accounting usually face an issue of not finding appropriate Chart of Accounts (COA) and failing unit tests as a result. This happens with the module `account_cost_center` as well, as you can see from error log (I will add it as a comment, to avoid clogging this issue).\r\n\r\nLuckily, this problem can be easily fixed by changing the class, used for running unit tests, related to accounting, simply change `TransactionCase` with `AccountingTestCase`, which will run unit tests after COA is loaded.\r\n\r\nSo, you can solve it by changing two lines of code in `addons-onestein/account_cost_center/tests/test_cost_center.py`:\r\n```python\r\n# from odoo.tests import common\r\nfrom odoo.addons.account.tests.account_test_classes import AccountingTestCase\r\n\r\n\r\n# class TestAccountCostCenter(common.TransactionCase):\r\nclass TestAccountCostCenter(AccountingTestCase):\r\n```\r\n\r\nOld code is commented, recommended new code is written below.\r\nWe are very interested in seeing this change in branch 11.0 as soon as possible, in order to see green odoo.sh again, thanks! :)"}}
{"actor":{"display_login":"astirpe"}}