formatting

This commit is contained in:
Frederik Jaeckel 2023-06-30 11:36:17 +02:00
parent e893c1be2b
commit c4571a28b9
6 changed files with 65 additions and 68 deletions

View file

@ -1,23 +1,18 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
# -*- coding: utf-8 -*-
# This file is part of the edocument-module for Tryton from m-ds.de.
# The COPYRIGHT file at the top level of this repository contains the
# full copyright notices and license terms.
import trytond.tests.test_tryton
import unittest
from trytond.modules.edocument_xrechnung.tests.test_edocument import EdocTestCase
from .test_edocument import EdocTestCase
__all__ = ['suite']
class EDocumentTestCase(\
EdocTestCase,\
):
'Test edocument module'
module = 'edocument_xrechnung'
# end EDocumentTestCase
def suite():
suite = trytond.tests.test_tryton.suite()
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(EDocumentTestCase))
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
EdocTestCase))
return suite

View file

@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# This file is part of the cashbook-module from m-ds for Tryton.
# This file is part of the edocument-module for Tryton from m-ds.de.
# 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.modules.edocument_uncefact.tests.test_module import get_invoice
from unittest.mock import Mock, MagicMock
from unittest.mock import Mock
from decimal import Decimal
@ -20,7 +20,6 @@ class EdocTestCase(ModuleTestCase):
"""
pool = Pool()
Template = pool.get('edocument.xrechnung.invoice')
Address = pool.get('party.address')
Identifier = pool.get('party.identifier')
Party = pool.get('party.party')
Bank = pool.get('bank')
@ -28,19 +27,22 @@ class EdocTestCase(ModuleTestCase):
BankNumber = pool.get('bank.account.number')
invoice = get_invoice()
invoice.party.get_xrechnung_route_id = Mock(return_value='xrechn-route-id-123')
invoice.party.get_xrechnung_route_id = Mock(
return_value='xrechn-route-id-123')
invoice.company.party.bank_accounts = [
Mock(spec=BankAccount,
Mock(
spec=BankAccount,
currency=invoice.currency,
bank=Mock(spec=Bank, party=Mock(spec=Party, name='Bank')),
owners = [invoice.company.party],
numbers = [Mock(spec=BankNumber, type='other', number='123456')],
owners=[invoice.company.party],
numbers=[Mock(spec=BankNumber, type='other', number='123456')],
)]
invoice.description = 'description of invoice'
invoice.comment = 'note line 1\nnote line 2'
invoice.taxes[0].tax.rate = Decimal('0.1')
invoice.identifiers = [
Mock(spec=Identifier,
Mock(
spec=Identifier,
type='edoc_route_id',
code='xrechn-route-id-123')
]
@ -52,4 +54,5 @@ class EdocTestCase(ModuleTestCase):
# end EdocTestCase
del ModuleTestCase