跳至內容
選單
此問題已被標幟
1 回覆
3555 瀏覽次數

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)?

頭像
捨棄
最佳答案

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....

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
12月 19
3160
2
12月 24
2335
1
11月 22
3602
2
2月 22
5707
1
2月 22
4080