book, line, category, types: berechtigung für company-user + test,

book: währung neu,
line: buchungstyp, betrag, credit, debit, währung, sortierung
This commit is contained in:
Frederik Jaeckel 2022-08-10 16:30:08 +02:00
parent 1a85b8e80e
commit d57d76ba3b
20 changed files with 620 additions and 115 deletions

View file

@ -13,17 +13,20 @@ class TypeTestCase(ModuleTestCase):
'Test cashbook type module'
module = 'cashbook'
@with_transaction()
def test_type_read_existing(self):
""" read predefined types
def prep_type(self, name='Cash', short='CAS'):
""" create book-type
"""
AccType = Pool().get('cashbook.type')
t_lst = AccType.search([], order=[('name', 'ASC')])
self.assertEqual(len(t_lst), 3)
self.assertEqual(t_lst[0].rec_name, 'CAS - Cash')
self.assertEqual(t_lst[1].rec_name, 'FTD - Fixed-term deposit')
self.assertEqual(t_lst[2].rec_name, 'GIR - Giro')
company = self.prep_company()
at, = AccType.create([{
'name': name,
'short': short,
'company': company.id,
}])
self.assertEqual(at.name, name)
self.assertEqual(at.short, short)
return at
@with_transaction()
def test_type_create(self):
@ -31,9 +34,12 @@ class TypeTestCase(ModuleTestCase):
"""
AccType = Pool().get('cashbook.type')
company = self.prep_company()
at, = AccType.create([{
'name': 'Test 1',
'short': 'T1',
'company': company.id,
}])
self.assertEqual(at.name, 'Test 1')
self.assertEqual(at.short, 'T1')
@ -45,6 +51,7 @@ class TypeTestCase(ModuleTestCase):
[{
'name': 'Test 2',
'short': 'T1',
'company': company.id,
}])
# end TypeTestCase