2022-10-28 17:31:37 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# This file is part of the cashbook-module from m-ds for Tryton.
|
|
|
|
# The COPYRIGHT file at the top level of this repository contains the
|
|
|
|
# full copyright notices and license terms.
|
|
|
|
|
|
|
|
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
|
|
|
|
from trytond.pool import Pool
|
|
|
|
from trytond.transaction import Transaction
|
|
|
|
from trytond.exceptions import UserError
|
|
|
|
from trytond.modules.cashbook.tests import CashbookTestCase
|
|
|
|
from datetime import date
|
|
|
|
from decimal import Decimal
|
|
|
|
|
|
|
|
|
|
|
|
class ReportTestCase(CashbookTestCase):
|
|
|
|
'Test cashbook book report module'
|
|
|
|
module = 'cashbook_report'
|
|
|
|
|
|
|
|
def prep_report_3books(self):
|
|
|
|
""" create 3x cashbooks, add bookings,
|
|
|
|
"""
|
|
|
|
pool = Pool()
|
|
|
|
Book = pool.get('cashbook.book')
|
2022-10-30 21:35:24 +00:00
|
|
|
ResUser = pool.get('res.user')
|
2022-10-28 17:31:37 +00:00
|
|
|
|
2022-10-30 21:35:24 +00:00
|
|
|
user_admin, = ResUser.search([])
|
2022-10-29 21:05:27 +00:00
|
|
|
type_cash = self.prep_type()
|
|
|
|
type_bank = self.prep_type(name='Bank', short='BK')
|
2022-10-28 17:31:37 +00:00
|
|
|
company = self.prep_company()
|
2022-10-30 21:35:24 +00:00
|
|
|
|
|
|
|
ResUser.write(*[
|
|
|
|
[user_admin],
|
|
|
|
{
|
|
|
|
'companies': [('add', [company.id])],
|
|
|
|
'company': company.id,
|
|
|
|
}])
|
|
|
|
self.assertEqual(user_admin.company.id, company.id)
|
|
|
|
|
2022-10-29 21:05:27 +00:00
|
|
|
(usd, euro) = self.prep_2nd_currency(company)
|
2022-10-28 17:31:37 +00:00
|
|
|
sequ_id = self.prep_sequence().id
|
|
|
|
category = self.prep_category(cattype='in')
|
|
|
|
party = self.prep_party()
|
|
|
|
books = Book.create([{
|
|
|
|
'name': 'Book 1',
|
2022-10-29 21:05:27 +00:00
|
|
|
'btype': type_cash.id,
|
2022-10-28 17:31:37 +00:00
|
|
|
'company': company.id,
|
2022-10-29 21:05:27 +00:00
|
|
|
'currency': usd.id,
|
2022-10-28 17:31:37 +00:00
|
|
|
'number_sequ': sequ_id,
|
|
|
|
'start_date': date(2022, 4, 1),
|
|
|
|
'lines': [('create', [{
|
|
|
|
'date': date(2022, 5, 5),
|
|
|
|
'description': 'Income 1a',
|
|
|
|
'bookingtype': 'in',
|
|
|
|
'amount': Decimal('10.0'),
|
|
|
|
'category': category.id,
|
|
|
|
'party': party.id,
|
|
|
|
}, {
|
|
|
|
'date': date(2022, 5, 5),
|
|
|
|
'description': 'Income 1b',
|
|
|
|
'bookingtype': 'in',
|
|
|
|
'amount': Decimal('15.0'),
|
|
|
|
'category': category.id,
|
|
|
|
'party': party.id,
|
|
|
|
}])],
|
|
|
|
}, {
|
|
|
|
'name': 'Book 2',
|
2022-10-29 21:05:27 +00:00
|
|
|
'btype': type_cash.id,
|
2022-10-28 17:31:37 +00:00
|
|
|
'company': company.id,
|
2022-10-29 21:05:27 +00:00
|
|
|
'currency': usd.id,
|
2022-10-28 17:31:37 +00:00
|
|
|
'number_sequ': sequ_id,
|
|
|
|
'start_date': date(2022, 4, 1),
|
|
|
|
'lines': [('create', [{
|
|
|
|
'date': date(2022, 5, 5),
|
|
|
|
'description': 'Income 2a',
|
|
|
|
'bookingtype': 'in',
|
|
|
|
'amount': Decimal('5.0'),
|
|
|
|
'category': category.id,
|
|
|
|
'party': party.id,
|
|
|
|
}, {
|
|
|
|
'date': date(2022, 5, 5),
|
|
|
|
'description': 'Income 2b',
|
|
|
|
'bookingtype': 'in',
|
|
|
|
'amount': Decimal('7.5'),
|
|
|
|
'category': category.id,
|
|
|
|
'party': party.id,
|
|
|
|
}])],
|
|
|
|
}, {
|
|
|
|
'name': 'Book 3',
|
2022-10-29 21:05:27 +00:00
|
|
|
'btype': type_bank.id,
|
2022-10-28 17:31:37 +00:00
|
|
|
'company': company.id,
|
2022-10-29 21:05:27 +00:00
|
|
|
'currency': euro.id,
|
2022-10-28 17:31:37 +00:00
|
|
|
'number_sequ': sequ_id,
|
|
|
|
'start_date': date(2022, 4, 1),
|
|
|
|
'lines': [('create', [{
|
|
|
|
'date': date(2022, 5, 5),
|
|
|
|
'description': 'Income 3a',
|
|
|
|
'bookingtype': 'in',
|
|
|
|
'amount': Decimal('12.5'),
|
|
|
|
'category': category.id,
|
|
|
|
'party': party.id,
|
|
|
|
}, {
|
|
|
|
'date': date(2022, 5, 5),
|
|
|
|
'description': 'Income 3b',
|
|
|
|
'bookingtype': 'in',
|
|
|
|
'amount': Decimal('10.5'),
|
|
|
|
'category': category.id,
|
|
|
|
'party': party.id,
|
|
|
|
}])],
|
|
|
|
}])
|
|
|
|
self.assertEqual(len(books), 3)
|
|
|
|
self.assertEqual(books[0].name, 'Book 1')
|
2022-10-29 21:05:27 +00:00
|
|
|
self.assertEqual(books[0].btype.rec_name, 'CAS - Cash')
|
2022-10-28 17:31:37 +00:00
|
|
|
self.assertEqual(len(books[0].lines), 2)
|
|
|
|
self.assertEqual(books[0].balance, Decimal('25.0'))
|
|
|
|
|
|
|
|
self.assertEqual(books[1].name, 'Book 2')
|
2022-10-29 21:05:27 +00:00
|
|
|
self.assertEqual(books[1].btype.rec_name, 'CAS - Cash')
|
2022-10-28 17:31:37 +00:00
|
|
|
self.assertEqual(len(books[1].lines), 2)
|
|
|
|
self.assertEqual(books[1].balance, Decimal('12.5'))
|
|
|
|
|
|
|
|
self.assertEqual(books[2].name, 'Book 3')
|
2022-10-29 21:05:27 +00:00
|
|
|
self.assertEqual(books[2].btype.rec_name, 'BK - Bank')
|
2022-10-28 17:31:37 +00:00
|
|
|
self.assertEqual(len(books[2].lines), 2)
|
|
|
|
self.assertEqual(books[2].balance, Decimal('23.0'))
|
|
|
|
return books
|
|
|
|
|
2022-10-30 21:35:24 +00:00
|
|
|
@with_transaction()
|
|
|
|
def test_report_currency_hasbookings(self):
|
|
|
|
""" check detectpn of bookings @ currency
|
|
|
|
"""
|
|
|
|
pool = Pool()
|
|
|
|
Currency = pool.get('currency.currency')
|
|
|
|
Lines = pool.get('cashbook.line')
|
|
|
|
|
|
|
|
books = self.prep_report_3books()
|
|
|
|
|
|
|
|
company = self.prep_company()
|
|
|
|
with Transaction().set_context({
|
|
|
|
'company': company.id,
|
|
|
|
}):
|
|
|
|
self.assertEqual(len(books[0].lines), 2)
|
|
|
|
self.assertEqual(books[0].currency.code, 'usd')
|
|
|
|
self.assertEqual(len(books[1].lines), 2)
|
|
|
|
self.assertEqual(books[1].currency.code, 'usd')
|
|
|
|
self.assertEqual(len(books[2].lines), 2)
|
|
|
|
self.assertEqual(books[2].currency.code, 'EUR')
|
|
|
|
|
|
|
|
euro, = Currency.search([('code', '=', 'EUR')])
|
|
|
|
self.assertEqual(euro.cashbook_hasbookings, True)
|
|
|
|
self.assertEqual(Currency.search_count([
|
|
|
|
('cashbook_hasbookings', '=', True)
|
|
|
|
]), 2)
|
|
|
|
|
|
|
|
Lines.delete(books[2].lines)
|
|
|
|
self.assertEqual(euro.cashbook_hasbookings, False)
|
|
|
|
|
|
|
|
self.assertEqual(Currency.search_count([
|
|
|
|
('cashbook_hasbookings', '=', True)
|
|
|
|
]), 1)
|
|
|
|
|
|
|
|
usd, = Currency.search([('code', '=', 'usd')])
|
|
|
|
self.assertEqual(usd.cashbook_hasbookings, True)
|
|
|
|
|
|
|
|
Lines.delete(books[0].lines)
|
|
|
|
self.assertEqual(usd.cashbook_hasbookings, True)
|
|
|
|
Lines.delete(books[1].lines)
|
|
|
|
self.assertEqual(usd.cashbook_hasbookings, False)
|
|
|
|
|
|
|
|
self.assertEqual(Currency.search_count([
|
|
|
|
('cashbook_hasbookings', '=', True)
|
|
|
|
]), 0)
|
|
|
|
|
2022-10-29 21:05:27 +00:00
|
|
|
@with_transaction()
|
|
|
|
def test_report_dtype_update(self):
|
2022-11-03 22:28:57 +00:00
|
|
|
""" check unlink of cashbooks/types/currencies
|
2022-10-29 21:05:27 +00:00
|
|
|
"""
|
|
|
|
pool = Pool()
|
|
|
|
Evaluation = pool.get('cashbook_report.evaluation')
|
|
|
|
Types = pool.get('cashbook.type')
|
|
|
|
Currency = pool.get('currency.currency')
|
|
|
|
|
|
|
|
books = self.prep_report_3books()
|
|
|
|
|
|
|
|
company = self.prep_company()
|
|
|
|
with Transaction().set_context({
|
|
|
|
'company': company.id,
|
|
|
|
}):
|
|
|
|
# valid
|
|
|
|
evaluation, = Evaluation.create([{
|
|
|
|
'name': 'Evaluation 1',
|
|
|
|
'dtype': 'cashbooks',
|
|
|
|
'cashbooks': [('add', [x.id for x in books])],
|
|
|
|
}])
|
|
|
|
self.assertEqual(len(evaluation.cashbooks), 3)
|
|
|
|
self.assertEqual(len(evaluation.types), 0)
|
|
|
|
self.assertEqual(len(evaluation.currencies), 0)
|
|
|
|
|
|
|
|
Evaluation.write(*[
|
|
|
|
[evaluation],
|
|
|
|
{
|
|
|
|
'dtype': 'types',
|
|
|
|
'types': [('add', [x.id for x in Types.search([])])],
|
|
|
|
}])
|
|
|
|
self.assertEqual(len(evaluation.cashbooks), 0)
|
|
|
|
self.assertEqual(len(evaluation.types), 2)
|
|
|
|
self.assertEqual(len(evaluation.currencies), 0)
|
|
|
|
|
|
|
|
# write same dtype again - no change
|
|
|
|
Evaluation.write(*[
|
|
|
|
[evaluation],
|
|
|
|
{
|
|
|
|
'dtype': 'types',
|
|
|
|
}])
|
|
|
|
self.assertEqual(len(evaluation.cashbooks), 0)
|
|
|
|
self.assertEqual(len(evaluation.types), 2)
|
|
|
|
self.assertEqual(len(evaluation.currencies), 0)
|
|
|
|
|
|
|
|
Evaluation.write(*[
|
|
|
|
[evaluation],
|
|
|
|
{
|
|
|
|
'dtype': 'currencies',
|
|
|
|
'currencies': [('add', [x.id for x in Currency.search([])])],
|
|
|
|
}])
|
|
|
|
self.assertEqual(len(evaluation.cashbooks), 0)
|
|
|
|
self.assertEqual(len(evaluation.types), 0)
|
|
|
|
self.assertEqual(len(evaluation.currencies), 2)
|
|
|
|
|
|
|
|
Evaluation.write(*[
|
|
|
|
[evaluation],
|
|
|
|
{
|
|
|
|
'dtype': 'cashbooks',
|
|
|
|
}])
|
|
|
|
self.assertEqual(len(evaluation.cashbooks), 0)
|
|
|
|
self.assertEqual(len(evaluation.types), 0)
|
|
|
|
self.assertEqual(len(evaluation.currencies), 0)
|
|
|
|
|
|
|
|
@with_transaction()
|
|
|
|
def test_report_dtype_validation(self):
|
|
|
|
""" check validation of dtype
|
|
|
|
"""
|
|
|
|
pool = Pool()
|
|
|
|
Evaluation = pool.get('cashbook_report.evaluation')
|
|
|
|
Types = pool.get('cashbook.type')
|
|
|
|
|
|
|
|
books = self.prep_report_3books()
|
|
|
|
|
|
|
|
company = self.prep_company()
|
|
|
|
with Transaction().set_context({
|
|
|
|
'company': company.id,
|
|
|
|
}):
|
|
|
|
# valid
|
|
|
|
evaluation, = Evaluation.create([{
|
|
|
|
'name': 'Evaluation 1',
|
|
|
|
'dtype': 'cashbooks',
|
|
|
|
'cashbooks': [('add', [x.id for x in books])],
|
|
|
|
}])
|
|
|
|
|
|
|
|
# must fail
|
|
|
|
self.assertRaisesRegex(UserError,
|
2022-11-03 22:28:57 +00:00
|
|
|
'A value is required for field "Type" in "Evaluation Line Relation".',
|
2022-10-29 21:05:27 +00:00
|
|
|
Evaluation.create,
|
|
|
|
[{
|
|
|
|
'name': 'Evaluation 1',
|
|
|
|
'dtype': 'types', # wrong dtype
|
|
|
|
'cashbooks': [('add', [x.id for x in books])],
|
|
|
|
}])
|
|
|
|
|
2022-10-31 12:57:39 +00:00
|
|
|
evaluation, = Evaluation.create([{
|
|
|
|
'name': 'Evaluation 2',
|
|
|
|
'dtype': 'types',
|
|
|
|
'types': [('add', [x.id for x in Types.search([])])],
|
|
|
|
}])
|
|
|
|
|
|
|
|
# must fail
|
|
|
|
self.assertRaisesRegex(UserError,
|
2022-11-03 22:28:57 +00:00
|
|
|
'A value is required for field "Cashbook" in "Evaluation Line Relation".',
|
2022-10-31 12:57:39 +00:00
|
|
|
Evaluation.create,
|
|
|
|
[{
|
|
|
|
'name': 'Evaluation 3',
|
|
|
|
'dtype': 'cashbooks',
|
|
|
|
'types': [('add', [x.id for x in Types.search([])])],
|
|
|
|
}])
|
|
|
|
|
2022-10-28 17:31:37 +00:00
|
|
|
@with_transaction()
|
|
|
|
def test_report_chart_pie_book_red(self):
|
|
|
|
""" create 3x cashbooks, add bookings,
|
2022-10-29 21:05:27 +00:00
|
|
|
create report with cashbooks, check
|
2022-10-28 17:31:37 +00:00
|
|
|
"""
|
|
|
|
Evaluation = Pool().get('cashbook_report.evaluation')
|
|
|
|
|
|
|
|
books = self.prep_report_3books()
|
|
|
|
|
|
|
|
company = self.prep_company()
|
|
|
|
with Transaction().set_context({
|
|
|
|
'company': company.id,
|
|
|
|
}):
|
|
|
|
evaluation, = Evaluation.create([{
|
|
|
|
'name': 'Evaluation 1',
|
2022-10-29 21:05:27 +00:00
|
|
|
'cashbooks': [('add', [x.id for x in books])],
|
2022-10-28 17:31:37 +00:00
|
|
|
}])
|
2022-10-29 21:05:27 +00:00
|
|
|
self.assertEqual(evaluation.dtype, 'cashbooks')
|
2022-10-28 17:31:37 +00:00
|
|
|
self.assertEqual(evaluation.chart, 'pie')
|
|
|
|
self.assertEqual(evaluation.legend, True)
|
|
|
|
self.assertEqual(evaluation.posted, False)
|
|
|
|
self.assertEqual(evaluation.maincolor, 'default')
|
|
|
|
self.assertEqual(evaluation.bgcolor, '#ffffc0')
|
2022-10-31 12:57:39 +00:00
|
|
|
self.assertEqual(evaluation.currency.code, 'EUR')
|
2022-10-28 17:31:37 +00:00
|
|
|
|
2022-11-02 22:07:37 +00:00
|
|
|
# check uiview
|
|
|
|
self.assertEqual(evaluation.ui_view_chart.model, 'cashbook_report.eval_book')
|
|
|
|
self.assertEqual(evaluation.ui_view_chart.module, 'cashbook_report')
|
|
|
|
self.assertEqual(evaluation.ui_view_chart.priority, 10)
|
|
|
|
self.assertEqual(evaluation.ui_view_chart.type, 'graph')
|
|
|
|
self.assertEqual(evaluation.ui_view_chart.data, """<?xml version="1.0"?>
|
|
|
|
<graph type="pie" legend="1" background="#ffffc0">
|
|
|
|
<x>
|
|
|
|
<field name="name"/>
|
|
|
|
</x>
|
|
|
|
<y>
|
|
|
|
<field name="balance" fill="1" empty="0" string="cashbooks"/>
|
|
|
|
</y>
|
|
|
|
</graph>
|
|
|
|
""")
|
|
|
|
|
2022-10-29 21:05:27 +00:00
|
|
|
self.assertEqual(len(evaluation.cashbooks), 3)
|
|
|
|
self.assertEqual(evaluation.cashbooks[0].rec_name, 'Book 1 | 25.00 usd | Open')
|
|
|
|
self.assertEqual(evaluation.cashbooks[1].rec_name, 'Book 2 | 12.50 usd | Open')
|
|
|
|
self.assertEqual(evaluation.cashbooks[2].rec_name, 'Book 3 | 23.00 € | Open')
|
2022-10-31 12:57:39 +00:00
|
|
|
self.assertEqual(evaluation.cashbooks[0].currency.code, 'usd')
|
|
|
|
self.assertEqual(evaluation.cashbooks[1].currency.code, 'usd')
|
|
|
|
self.assertEqual(evaluation.cashbooks[2].currency.code, 'EUR')
|
|
|
|
|
2022-11-03 22:28:57 +00:00
|
|
|
self.assertEqual(len(evaluation.line_values), 3)
|
|
|
|
self.assertEqual(evaluation.line_values[0].name, 'Book 1 | 25.00 usd | Open')
|
|
|
|
self.assertEqual(evaluation.line_values[1].name, 'Book 2 | 12.50 usd | Open')
|
|
|
|
self.assertEqual(evaluation.line_values[2].name, 'Book 3 | 23.00 € | Open')
|
2022-10-31 12:57:39 +00:00
|
|
|
|
2022-11-03 22:28:57 +00:00
|
|
|
self.assertEqual(evaluation.line_values[0].eval_currency.code, 'EUR')
|
|
|
|
self.assertEqual(evaluation.line_values[1].eval_currency.code, 'EUR')
|
|
|
|
self.assertEqual(evaluation.line_values[2].eval_currency.code, 'EUR')
|
2022-10-31 12:57:39 +00:00
|
|
|
|
2022-11-03 22:28:57 +00:00
|
|
|
self.assertEqual(evaluation.line_values[0].balance, Decimal('23.81'))
|
|
|
|
self.assertEqual(evaluation.line_values[1].balance, Decimal('11.90'))
|
|
|
|
self.assertEqual(evaluation.line_values[2].balance, Decimal('23.00'))
|
2022-10-29 21:05:27 +00:00
|
|
|
|
|
|
|
@with_transaction()
|
|
|
|
def test_report_chart_pie_type_red(self):
|
|
|
|
""" create 3x cashbooks, add bookings,
|
|
|
|
create report with types of cashbooks, check
|
|
|
|
"""
|
|
|
|
pool = Pool()
|
|
|
|
Evaluation = pool.get('cashbook_report.evaluation')
|
|
|
|
Types = pool.get('cashbook.type')
|
|
|
|
|
|
|
|
books = self.prep_report_3books()
|
|
|
|
|
|
|
|
company = self.prep_company()
|
|
|
|
with Transaction().set_context({
|
2022-10-31 12:57:39 +00:00
|
|
|
'company': company.id, # company-currency: EUR
|
|
|
|
'date': date(2022, 5, 15),
|
2022-10-29 21:05:27 +00:00
|
|
|
}):
|
|
|
|
evaluation, = Evaluation.create([{
|
|
|
|
'name': 'Evaluation 1',
|
|
|
|
'dtype': 'types',
|
|
|
|
'types': [('add', [x.id for x in Types.search([])])],
|
|
|
|
}])
|
|
|
|
self.assertEqual(evaluation.dtype, 'types')
|
|
|
|
self.assertEqual(evaluation.chart, 'pie')
|
|
|
|
self.assertEqual(evaluation.legend, True)
|
|
|
|
self.assertEqual(evaluation.posted, False)
|
|
|
|
self.assertEqual(evaluation.maincolor, 'default')
|
|
|
|
self.assertEqual(evaluation.bgcolor, '#ffffc0')
|
2022-10-31 12:57:39 +00:00
|
|
|
self.assertEqual(evaluation.currency.code, 'EUR')
|
2022-10-29 21:05:27 +00:00
|
|
|
|
2022-10-31 12:57:39 +00:00
|
|
|
# 37.50 USD, Cash
|
|
|
|
# 23.00 EUR, Bank
|
2022-10-29 21:05:27 +00:00
|
|
|
self.assertEqual(len(evaluation.types), 2)
|
2022-10-31 12:57:39 +00:00
|
|
|
self.assertEqual(evaluation.types[0].rec_name, 'BK - Bank')
|
|
|
|
self.assertEqual(evaluation.types[1].rec_name, 'CAS - Cash')
|
|
|
|
# 23.00 EUR
|
2022-11-03 22:28:57 +00:00
|
|
|
self.assertEqual(len(evaluation.line_values), 2)
|
|
|
|
self.assertEqual(evaluation.line_values[0].eval_currency.code, 'EUR')
|
|
|
|
self.assertEqual(evaluation.line_values[0].name, 'BK - Bank')
|
|
|
|
self.assertEqual(evaluation.line_values[0].balance, Decimal('23.0'))
|
2022-10-31 12:57:39 +00:00
|
|
|
|
|
|
|
# 37.50 USD --> EUR
|
2022-11-03 22:28:57 +00:00
|
|
|
self.assertEqual(evaluation.line_values[1].name, 'CAS - Cash')
|
|
|
|
self.assertEqual(evaluation.line_values[1].eval_currency.code, 'EUR')
|
|
|
|
self.assertEqual(evaluation.line_values[1].balance, Decimal('35.71'))
|
2022-10-29 21:05:27 +00:00
|
|
|
|
|
|
|
@with_transaction()
|
|
|
|
def test_report_chart_pie_currency_red(self):
|
|
|
|
""" create 3x cashbooks, add bookings,
|
|
|
|
create report with types of cashbooks, check
|
|
|
|
"""
|
|
|
|
pool = Pool()
|
|
|
|
Evaluation = pool.get('cashbook_report.evaluation')
|
|
|
|
Currency = pool.get('currency.currency')
|
|
|
|
|
|
|
|
books = self.prep_report_3books()
|
|
|
|
|
|
|
|
company = self.prep_company()
|
|
|
|
with Transaction().set_context({
|
|
|
|
'company': company.id,
|
|
|
|
}):
|
|
|
|
evaluation, = Evaluation.create([{
|
|
|
|
'name': 'Evaluation 1',
|
|
|
|
'dtype': 'currencies',
|
|
|
|
'currencies': [('add', [x.id for x in Currency.search([])])],
|
|
|
|
}])
|
|
|
|
self.assertEqual(evaluation.dtype, 'currencies')
|
|
|
|
self.assertEqual(evaluation.chart, 'pie')
|
|
|
|
self.assertEqual(evaluation.legend, True)
|
|
|
|
self.assertEqual(evaluation.posted, False)
|
|
|
|
self.assertEqual(evaluation.maincolor, 'default')
|
|
|
|
self.assertEqual(evaluation.bgcolor, '#ffffc0')
|
2022-10-31 17:48:20 +00:00
|
|
|
self.assertEqual(evaluation.currency.code, 'EUR')
|
2022-10-29 21:05:27 +00:00
|
|
|
|
|
|
|
self.assertEqual(len(evaluation.currencies), 2)
|
2022-10-31 17:48:20 +00:00
|
|
|
self.assertEqual(evaluation.currencies[0].code, 'EUR')
|
|
|
|
self.assertEqual(evaluation.currencies[1].code, 'usd')
|
|
|
|
|
2022-11-03 22:28:57 +00:00
|
|
|
self.assertEqual(len(evaluation.line_values), 2)
|
|
|
|
self.assertEqual(evaluation.line_values[0].name, 'Euro')
|
|
|
|
self.assertEqual(evaluation.line_values[0].balance, Decimal('23.0'))
|
|
|
|
self.assertEqual(evaluation.line_values[1].name, 'usd')
|
|
|
|
self.assertEqual(evaluation.line_values[1].balance, Decimal('35.71'))
|
2022-10-29 21:05:27 +00:00
|
|
|
|
2022-10-28 17:31:37 +00:00
|
|
|
# end ReportTestCase
|