konfig: kassenbuch-default für buchungswizard
buchungswizard: ok + test
This commit is contained in:
parent
25db274d2d
commit
a2cb2b308b
8 changed files with 377 additions and 12 deletions
|
@ -42,6 +42,7 @@ class ConfigTestCase(ModuleTestCase):
|
|||
self.assertEqual(cfg2.checked, True)
|
||||
self.assertEqual(cfg2.done, False)
|
||||
self.assertEqual(cfg2.catnamelong, True)
|
||||
self.assertEqual(cfg2.defbook, None)
|
||||
return cfg2
|
||||
|
||||
def prep_party(self, name='Party'):
|
||||
|
@ -105,6 +106,37 @@ class ConfigTestCase(ModuleTestCase):
|
|||
"""
|
||||
self.prep_config()
|
||||
|
||||
@with_transaction()
|
||||
def test_config_defbook(self):
|
||||
""" create config, add default-cashbook
|
||||
"""
|
||||
pool = Pool()
|
||||
Configuration = pool.get('cashbook.configuration')
|
||||
Book = pool.get('cashbook.book')
|
||||
|
||||
self.prep_config()
|
||||
types = self.prep_type()
|
||||
company = self.prep_company()
|
||||
book, = Book.create([{
|
||||
'name': 'Book 1',
|
||||
'btype': types.id,
|
||||
'company': company.id,
|
||||
'currency': company.currency.id,
|
||||
'number_sequ': self.prep_sequence().id,
|
||||
}])
|
||||
self.assertEqual(book.name, 'Book 1')
|
||||
|
||||
cfg1 = Configuration.get_singleton()
|
||||
|
||||
Configuration.write(*[
|
||||
[cfg1],
|
||||
{
|
||||
'defbook': book.id,
|
||||
}])
|
||||
|
||||
cfg2 = Configuration.get_singleton()
|
||||
self.assertEqual(cfg2.defbook.rec_name, 'Book 1 | 0.00 usd | Open')
|
||||
|
||||
@with_transaction()
|
||||
def test_config_create_multi_user(self):
|
||||
""" create config, multi-user
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue