Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
6237 มุมมอง

Hi there, I have some problems running tests with Odoo 14.


When I ran tests with the --stop-after-init option, it doesn't run any tests at all.


Can somebody help me?


อวตาร
ละทิ้ง
ผู้เขียน

Thanks for your response @Devendra Kavthekar

But I already use --test-enable in combination with --stop-after-init . Odoo only stop after init but does not run tests

คำตอบที่ดีที่สุด

Make sure you already import the test folder inside __init__.py in your custom addon folder

`Make sure you already import the python inside __init__.py in your test inside your custom addon folder`

Then run the odoo with 

odoo --config=config.conf --database=db --test-enable --update=your_module

No need --stop-after-init (idk what it does anyway)

Tested with odoo 14. Testing with the python code

To make sure the test is running properly, use _logger.info to print any printable data. You'll see recognizable data

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I do have this problem as well, with Odoo 16. Very annoying

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Running tests
Tests are automatically run when installing or updating modules if --test-enable was enabled when starting the Odoo server.

https://www.odoo.com/documentation/15.0/developer/reference/addons/testing.html

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Does anyone has this problem?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 24
973
0
ก.พ. 20
4
0
มี.ค. 15
2987
3
ก.ย. 24
1436
0
พ.ค. 23
1604