Skip to Content

Contributors

Re: Issues when running tests

Hello,

it seems that your database contains no demo data.
The tests are only running with demo data.

Ensure that you creating your database without this flat "--without-demo" https://www.odoo.com/documentation/17.0/developer/reference/cli.html?highlight=demo#cmdoption-odoo-bin-without-demo



Am 26.03.24 um 20:57 schrieb Francesco Ballerini:
Hello,

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?

Thanks,
Fra B.


Privo di virus.www.avast.com

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe



by Michael Tietz - 09:06 - 26 Mar 2024

Reference

  • Issues when running tests
    Hello,

    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?

    Thanks,
    Fra B.


    Privo di virus.www.avast.com

    by Francesco Ballerini - 08:57 - 26 Mar 2024