Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Odoo 11 Development Cookbook - Second Edition

You're reading from   Odoo 11 Development Cookbook - Second Edition Over 120 unique recipes to build effective enterprise and business applications

Arrow left icon
Product type Paperback
Published in Jan 2018
Publisher Packt
ISBN-13 9781788471817
Length 470 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (23) Chapters Close

Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
1. Installing the Odoo Development Environment FREE CHAPTER 2. Managing Odoo Server Instances 3. Server Deployment 4. Creating Odoo Addon Modules 5. Application Models 6. Basic Server-Side Development 7. Module Data 8. Debugging and Automated Testing 9. Advanced Server-Side Development Techniques 10. Backend Views 11. Access Security 12. Internationalization 13. Automation, Workflows, Emails, and Printouts 14. Web Server Development 15. Web Client Development 16. CMS Website Development 1. Other Books You May Enjoy Index

Running server tests


Now that you know how to write tests, let's see how you can run them!

Getting ready

We will reuse the tests for the my_module module from one of the previous recipes. You will need an instance with the addon installed. In this recipe, we assume that the instance configuration file is in project.cfg.

How to do it...

To run the tests for my module addon, install the module with demo data:

$ ./odoo-bin -c project.cfg --without-demo=False --stop-after-init \ 
-i my_module

Then, run the following command:

$ ./odoo-bin -c project.cfg --test-enable --log-level=error \ 
--stop-after-init -u my_module

How it works...

The key part in this recipe is the --test-enable command-line flag that tells Odoo to run the tests. The --stop-after-init flag will stop the instance after the tests have run, and -u will update the specified module. When an update (or install) is performed with tests enabled, all the affected addon modules' tests are run (this includes dependencies automatically installed...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images