Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3711 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
pro 19
3341
2
pro 24
2659
1
lis 22
3786
2
úno 22
5871
1
úno 22
4277