Odoo Help


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.


Writing tests with new v8 api?

Andrius Laukavičius
on 9/22/14, 3:51 AM 874 views

I want to write tests on v8 modules, but dont seem to find a way to use new api. In all examples I see that cr, uid is still used etc. Is it possible to write tests with new api. If so how (any references etc)?


Jusab Sida (jsi)

--Jusab Sida (jsi)--
Tiny ERP Pvt Ltd
| 2 1 5
Gandhinagar, India
--Jusab Sida (jsi)--

Jusab Sida (jsi)
On 2/25/15, 1:22 AM

Hello Andrius Laukavičius,

             Yes, you can write tests using all new api stuff.


from openerp.tests import common

class testPartnerCreate(common.TransactionCase):
    def setUp(self):
        super(testPartnerCreate, self).setUp()

    def test_create(self):
        res_partner = self.env['res.partner']

        test_partner1 = res_partner.create(
                name="Demo bhai",
                city="test city",


Hope this will help.


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

1 follower(s)


Asked: 9/22/14, 3:51 AM
Seen: 874 times
Last updated: 3/16/15, 8:10 AM