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')
|
'[Lev 0/Lev 1b | 0.00 € | Open]|balance_ref|0.00|2')
|
||||||
|
|
||||||
# add bookings
|
# add bookings
|
||||||
Line.create([{
|
Line.create(self.prep_valstore_line_create_data(
|
||||||
|
[{
|
||||||
'cashbook': values[0].cashbook.id, # Lev 0
|
'cashbook': values[0].cashbook.id, # Lev 0
|
||||||
'amount': Decimal('2.0'),
|
'amount': Decimal('2.0'),
|
||||||
'bookingtype': 'in',
|
'bookingtype': 'in',
|
||||||
|
@ -457,7 +458,7 @@ class ValuestoreTestCase(object):
|
||||||
'bookingtype': 'in',
|
'bookingtype': 'in',
|
||||||
'category': category.id,
|
'category': category.id,
|
||||||
'date': date(2022, 5, 10),
|
'date': date(2022, 5, 10),
|
||||||
}])
|
}]))
|
||||||
|
|
||||||
# add 'date' to context, will return computed
|
# add 'date' to context, will return computed
|
||||||
# (not stored) values
|
# (not stored) values
|
||||||
|
@ -572,6 +573,11 @@ class ValuestoreTestCase(object):
|
||||||
values[8].rec_name,
|
values[8].rec_name,
|
||||||
'[Lev 0/Lev 1b | 0.00 € | Open]|balance_ref|0.00|2')
|
'[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()
|
@with_transaction()
|
||||||
def test_valstore_search_sort_books(self):
|
def test_valstore_search_sort_books(self):
|
||||||
""" create cashbooks add lines, search/sort
|
""" 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[1].rec_name, 'Cashbook 2 | 0.00 € | Open')
|
||||||
self.assertEqual(books[2].rec_name, 'Cashbook 3 | 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,
|
'cashbook': books[1].id,
|
||||||
'bookingtype': 'in',
|
'bookingtype': 'in',
|
||||||
'amount': Decimal('5.0'),
|
'amount': Decimal('5.0'),
|
||||||
|
@ -637,7 +644,7 @@ class ValuestoreTestCase(object):
|
||||||
'date': date(2022, 5, 7),
|
'date': date(2022, 5, 7),
|
||||||
'description': '6€ in',
|
'description': '6€ in',
|
||||||
'category': category.id,
|
'category': category.id,
|
||||||
}])
|
}]))
|
||||||
|
|
||||||
# no 'date' in context, using stored values
|
# no 'date' in context, using stored values
|
||||||
# workers not yet processed
|
# workers not yet processed
|
||||||
|
|
Loading…
Reference in a new issue