İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
3531 Görünümler

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

Avatar
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Ara 19
3138
2
Ara 24
2320
1
Kas 22
3587
2
Şub 22
5701
1
Şub 22
4067