bok, line, type, line-open-wizard, context

This commit is contained in:
Frederik Jaeckel 2022-08-05 16:47:43 +02:00
parent a9f3eb12b4
commit ba442b726e
23 changed files with 974 additions and 8 deletions

24
tests/__init__.py Normal file
View file

@ -0,0 +1,24 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import trytond.tests.test_tryton
import unittest
from trytond.modules.cashbook.tests.test_accounttype import AccounttypeTestCase
__all__ = ['suite']
class CashbookTestCase(\
AccounttypeTestCase,
):
'Test cashbook module'
module = 'cashbook'
# end CashbookTestCase
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(CashbookTestCase))
return suite

37
tests/test_accounttype.py Normal file
View file

@ -0,0 +1,37 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import os, requests
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
from trytond.pool import Pool
from trytond.transaction import Transaction
from trytond.exceptions import UserError
class AccounttypeTestCase(ModuleTestCase):
'Test account type module'
module = 'cashbook'
@with_transaction()
def test_accounttype_create(self):
""" create account type
"""
AccType = Pool().get('cashbook.type')
at, = AccType.create([{
'name': 'Test 1',
'short': 'T1',
}])
self.assertEqual(at.name, 'Test 1')
self.assertEqual(at.short, 'T1')
# check unique of short
self.assertRaisesRegex(UserError,
'The Abbreviation must be unique.',
AccType.create,
[{
'name': 'Test 2',
'short': 'T1',
}])
# end AccounttypeTestCase