Help

0

Demo data not available in tests

Avatar
Huzaifa Qamer

Hi,

I have an XML file through which I intend to load testing data. I have included it in  'demo' in the __manifest__.py file but the data does not get loaded into the database when I run tests.

If I include it in 'data' in __manifest__.py the data gets loaded but as I understand it should be included in 'demo' so that data is only available during test execution.

My query

product = self.env['product.product'].search([('default_code', '=', 'TEST0002')])

My command

./odoo-bin -c /etc/odoo-server.conf -d <db_name> -i <module_name>  --test-enable --stop-after-init --log-level=test

Avatar
Discard
1 Answer
0
Best Answer

Hello Huzaifa Qamer,

You are creating the demo data so it will only affect at the time of module installation. Once the app is installed it has no effect on demo data.

Thanks..

For More Information Contact us :- https://kanakinfosystems.com/odoo-development-services

Avatar
Discard