tests valuestore: allow add of data to cashbook-line
This commit is contained in:
parent
d0f5b0aa38
commit
206cd1e0e5
1 changed files with 11 additions and 4 deletions
|
@ -445,7 +445,8 @@ class ValuestoreTestCase(object):
|
|||
'[Lev 0/Lev 1b | 0.00 € | Open]|balance_ref|0.00|2')
|
||||
|
||||
# add bookings
|
||||
Line.create([{
|
||||
Line.create(self.prep_valstore_line_create_data(
|
||||
[{
|
||||
'cashbook': values[0].cashbook.id, # Lev 0
|
||||
'amount': Decimal('2.0'),
|
||||
'bookingtype': 'in',
|
||||
|
@ -457,7 +458,7 @@ class ValuestoreTestCase(object):
|
|||
'bookingtype': 'in',
|
||||
'category': category.id,
|
||||
'date': date(2022, 5, 10),
|
||||
}])
|
||||
}]))
|
||||
|
||||
# add 'date' to context, will return computed
|
||||
# (not stored) values
|
||||
|
@ -572,6 +573,11 @@ class ValuestoreTestCase(object):
|
|||
values[8].rec_name,
|
||||
'[Lev 0/Lev 1b | 0.00 € | Open]|balance_ref|0.00|2')
|
||||
|
||||
def prep_valstore_line_create_data(self, query):
|
||||
""" allow add of data
|
||||
"""
|
||||
return query
|
||||
|
||||
@with_transaction()
|
||||
def test_valstore_search_sort_books(self):
|
||||
""" create cashbooks add lines, search/sort
|
||||
|
@ -623,7 +629,8 @@ class ValuestoreTestCase(object):
|
|||
self.assertEqual(books[1].rec_name, 'Cashbook 2 | 0.00 € | Open')
|
||||
self.assertEqual(books[2].rec_name, 'Cashbook 3 | 0.00 € | Open')
|
||||
|
||||
Line.create([{
|
||||
Line.create(self.prep_valstore_line_create_data(
|
||||
[{
|
||||
'cashbook': books[1].id,
|
||||
'bookingtype': 'in',
|
||||
'amount': Decimal('5.0'),
|
||||
|
@ -637,7 +644,7 @@ class ValuestoreTestCase(object):
|
|||
'date': date(2022, 5, 7),
|
||||
'description': '6€ in',
|
||||
'category': category.id,
|
||||
}])
|
||||
}]))
|
||||
|
||||
# no 'date' in context, using stored values
|
||||
# workers not yet processed
|
||||
|
|
Loading…
Reference in a new issue