summaryrefslogtreecommitdiff
path: root/addons/test_website/tests/__init__.py
AgeCommit message (Collapse)Author
2021-01-12[FIX] test_website: add tests for website.rewriteRomain Derie
Basic tests & tests of the 3 fixes of #64328
2020-12-09[FIX] web_editor, test_website: will fix the deletion of custom snippetsBenoit Socias
Before this commit the deletion of custom snippets failed because the button click event got intercepted by the drag'n'drop mechanism. The currentTarget of the event was used in an asynchronous call where it had already been replaced by the jQuery's event bubbling mechanism when invoking the other handler. After this commit the deletion of custom snippets works again and a test tour is introduced to make sure it does not get broken again task-2405854 closes odoo/odoo#62555 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-03-26[IMP] website: clean and add perf testsRomain Derie
- Refactor for easier readability - Add a test to ensure menu hierarchy scale correctly. - Add tests for image controllers - Add test for assets controllers task-2211013
2019-11-26[FIX] website: match get/post in is_multilang_urlJeremy Kersten
Old heuristic is not more True: Force to check method to POST. Odoo uses methods : ['POST'] and ['GET', 'POST'] We have some controller that only allow 'GET' method, so we need to check GET also when we try to know if an url is multilang or not. This commit fix case where a controller '/test' only allow GET and you were in another language that the default, in this case, the rendered url in qweb was /get instead of /<lang>/get. Closes #37223 closes odoo/odoo#40519 X-original-commit: c7650106f8588083be12812600a6c94ba703fd6f Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-10-17[FIX] website: allow authenticate in json multidbJeremy Kersten
Before this commit launch a server with --db-filter that match at least 2 dbs name Try to authenticate You will have an error request is unbound when you try to access request.env Now we retrieve the user from self instead of the request. New test to ensure rpc authentication is tested. Related to commit 245ef4b1 closes odoo/odoo#38969 X-original-commit: 4b3400c430bec7539aada0619fd203978daca2d8 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-28[IMP] test_website: add test tour for the website errorsfja-odoo
The purpose of these tests is to verify that errors informations are displayed correctly on the website. Part of https://github.com/odoo/odoo/pull/32132 task-1894820
2019-06-27[IMP] test_website: Add multi-company testlul-odoo
Purpose ======= This commit tests some behaviors with multi company mode after changes brought by f847a46. Specification ============= The website company should be automatically set in the context as 'allowed_company_ids'. That way, we can remove the switch company menu on the website, which doesn't make a lot of sense. This test enforce this behavior.
2019-06-08[IMP] odoo: ignore unsupported args from controllerJeremy Kersten
Before this commit, call a controller defined as: ``` @http.route('/route', type='http', auth='public') def controller_func(self, foo): do_it() ``` and called with url like /route?foo=1&bar=2 will crash with an exception: `TypeError: controller_func() got an unexpected keyword argument 'bar'` Now, we remove the extra parameters if the controller doesn't support it. This case is not uncommon, you can easily arrive in this case with utm or debug as extra parameter. closes odoo/odoo#33962 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-05[FIX] website: delete cow view on module updateRomain Derie
Before this commit, when a view was removed during a module update (eg: the record was deleted from the file), its COW views would not be deleted. This could lead to unwanted behaviors including tracebacks(1). This commit is somehow related/an extension of b5fe23055d that handle COW view write during module update and 2e32cc5aa3 that remove COW views during module uninstall. task-1931683 Note: Some existing tests had to be run post install (1) A view doing a t-call is COW'd, then that view and its t-called view are removed. If the cow view is not removed, the t-call will crash (see tests in this commit for detailed case). closes odoo/odoo#31295 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-02-13[FIX] website: restore reset_templates functionalityRomain Derie
Since AST was introduced to compile Qweb templates, the reset templates functionality is not working anymore. Actually, it does not even appear anymore as the conditions to trigger and show the reset view behavior can't be True anymore. Indeed, the code is still importing the old QWebException from odoo.exceptions which is now just an empty class. The QWebException that should now be used is the one from odoo.base.models.qweb More than just a wrong import, the QWebException properties have completely changed. Since its last working version (Odoo 9.0), a lot of changes occured, mostly: - Odoo 11.0: new model website.page, which completely changed the pages behavior and changed the models. - Odoo 12.0: multi-website, which introduced the Copy On Write (COW) that redefined how we write on view in a website context. We now need to reset copied/specific views that have no model_data_id. This fix is for a stable version. There is some flows that can't be fixed without a refactoring or new fields (mainly because of the arch_fs being erased when writing on `arch`, plus we can't introduce a module reload in stable). The goal of this commit is to fix the basic and standard case of broken views, which is when non-technical users are breaking the views through HTML editor. To reset the views, we will read the original arch in the XML file, as the dev mode is doing. To be eligible for the reset, the broken view need an `arch_fs` set. If the view arch has been modified anywhere else than the frontend, the `arch_fs` will be erased and the view wont be able to be reset. As the broken views will be specific views, we will simply read the generic view in the XML file and write it on the specific. We can't simply remove the specific view as we might be on a specific tree. Specific case, in case of custom views create dropping a snippet in an oe_struc we just delete this inehrited view to allow end user to have their page back. In some case of bad compilation in sub template, we try to guess which inherited view, t-called view is broken by string matching based on 'last_path_node' xpath. Add new module test_website to add tests, it will be usefull for futur test of install/uninstall and ... Todo in master: - try to track on QWebException the real template that is broken and not only the last node from the main template. Co-authored-by: "Romain Derie <rde@odoo.com>" Co-authored-by: "Jérémy Kersten <jke@openerp.com>" closes odoo/odoo#29957