I'm following Odoo 10 Development Essentials
Chapter 2 to develop a simple todo addon. I'm using odoo's docker as my environment.
You can check all my source code (including dockers') at https://github.com/spacegoing/docker_odoo
The problem is I set up my tests/
directory exactly the same as the book's example. However, the test only run once. After the first execution the test was never invoked. There is even no .pyc
file in tests
directory.
Here are the commands I tried
odoo --db_host db --db_port 5432 -r odoo -w odoo -i todo_app --test-enable --xmlrpc-port=8070 --logfile=/var/log/odoo/odoo_inst1.log
odoo --db_host db --db_port 5432 -r odoo -w odoo -u todo_app --test-enable --xmlrpc-port=8070 --logfile=/var/log/odoo/odoo_inst1.log
Notes:
odoo-bin
is odoo
in dockertodo_app
with another odoo
instance running on port 8069
Finally I found the answer. This is the hugest gotcha I've ever met since I'm 5 years old.
test
will only run after you installed the demo database
.I found this from this forum post: https://www.odoo.com/forum/help-1/question/why-my-test-yaml-do-not-run-42123
So if you tried every single command you can find and none of them works, this might be your answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With