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.

2

Writing tests with new v8 api?

By
Andrius Laukavičius
on 9/22/14, 3:51 AM 908 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)?

3

Jusab Sida (jsi)

--Jusab Sida (jsi)--
Tiny ERP Pvt Ltd
http://www.odoo.com
874
| 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.

like,

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(
            dict(
                name="Demo bhai",
                city="test city",
                email="demo@test.com",
            ))

           ......

Hope this will help.

Regards....

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)

Stats

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