Contributors mailing list archives

Browse archives


Re: Issues when running tests

Francesco Ballerini
- 27/03/2024 10:55:02
I take the freedom to ask an additional tip, this time is about writing tests: 

I made this PR which is only failing code coverage check by a 0,01% diff compared to last commit. 
This diff though, is marked as an indirect change due to partial coverage of a line which is defined in another module: see on code coverage . 
Is it possible for me to fix this missing coverage in my PR? Any hint on how to manage this? 

Thank you again,

Fra B.

Il giorno mar 26 mar 2024 alle ore 22:26 Francesco Ballerini <> ha scritto:
Thanks @Michael Tietz @Isabelle RICHARD, my brain often goes into "low battery mode" at the end of the day. I was running tests in a db without demo datas enabled and confusing master-data and demo data. 😁
Thank you very much

Francesco B.

Privo di

Il giorno mar 26 mar 2024 alle ore 21:12 Isabelle RICHARD <> ha scritto:
Hi Francesco,

You are talking about master data, but the product with the reference product.product_product_9 is a demo data.
It's only present in your database if you enabled the Demo Data option, when you created your database.

Did you enable this?


Isabelle RICHARD

Le mar. 26 mars 2024 à 20:57, Francesco Ballerini <> a écrit :

I am trying to run tests in my Odoo instance by adding --test enable but I'm having some issues. I am not used to run tests so I'm probably just missing something.

When I try to run tests for module sale_product_multi_add by launching command:

python3 odoo-bin -c odoo.conf -d dbname -u sale_product_multi_add --test-enable 

tests immediately fails because `self.env.ref()` cannot read external ids for master-datas. You can see the complete log in attached .txt

I have also tried to run the same command for module sale_product_brand_exception which also checks for master-data and I got the same error.

It seems like an issue with the environment, but addons path is defined in odoo.conf and working well outside of tests. I have also tried to pass --addons-path parameter in the CLI command but the result didn't changed.

I hope I have provided enough informations, if not, let me know.
Do you have any suggestions?

Fra B.

Privo di

Post to:

Post to: