Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

Getting started with odoo unit testing

By
Buddhima
on 6/16/15, 1:19 AM 825 views

According to the documentation, I created tests package and added some demo tests. But I cant see their execution. Simply this is what I have done.

my_module

     |------

     tests

            __init__.py

           test_my_test.py


Code in test_my_test.py

from openerp.tests import common

class TestStringMethods(common.TransactionCase):

        def setup(self):

                   print ("executing setup . . .")

                   super(TestStringMethods, self).setUp()

        def test_upper(self):

                   print ("executing test upper. . . ")

                   self.assertEqual('foo'.upper(), 'FOO')


In the __init__.py I imported test_my_test and imported tests in main __init__.py

Also added --test-enable parameter in run script.

When updating module, I can't see the execution of these test methods on console

0
Humberto
On 11/7/15, 5:15 PM

-i module_being_tested -d being_used_to_test --test-enable

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 6/16/15, 1:19 AM
Seen: 825 times
Last updated: 11/7/15, 5:15 PM