fix tests

This commit is contained in:
Frederik Jaeckel 2023-06-02 21:08:56 +02:00
parent bbe71a8252
commit a5dd469cf3
7 changed files with 28 additions and 34 deletions

View file

@ -3,7 +3,7 @@
# 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.tests.test_tryton import with_transaction
from trytond.pool import Pool
from trytond.transaction import Transaction
from trytond.exceptions import UserError
@ -11,10 +11,9 @@ from datetime import date
from decimal import Decimal
class BookTestCase(ModuleTestCase):
'Test cashbook book module'
module = 'cashbook'
class BookTestCase(object):
""" test cashbook
"""
def prep_sequence(self, name='Book Sequ'):
""" create numbering-equence
"""

View file

@ -3,7 +3,7 @@
# 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.tests.test_tryton import with_transaction
from trytond.pool import Pool
from trytond.transaction import Transaction
from datetime import date
@ -11,10 +11,9 @@ from decimal import Decimal
from unittest.mock import MagicMock
class BookingWizardTestCase(ModuleTestCase):
'Test cashbook booking wizard module'
module = 'cashbook'
class BookingWizardTestCase(object):
""" test booking wizard
"""
@with_transaction()
def test_bookwiz_expense(self):
""" run booking-wizard to store expense

View file

@ -3,16 +3,15 @@
# 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.tests.test_tryton import with_transaction
from trytond.pool import Pool
from trytond.transaction import Transaction
from trytond.exceptions import UserError
class CategoryTestCase(ModuleTestCase):
'Test cashbook categoy module'
module = 'cashbook'
class CategoryTestCase(object):
""" test category
"""
def prep_category(self, name='Cat1', cattype='out'):
""" create category
"""

View file

@ -3,7 +3,7 @@
# 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.tests.test_tryton import with_transaction
from trytond.pool import Pool
from trytond.transaction import Transaction
from trytond.modules.company.tests import create_company
@ -11,10 +11,9 @@ from datetime import date
from decimal import Decimal
class ConfigTestCase(ModuleTestCase):
'Test config type module'
module = 'cashbook'
class ConfigTestCase(object):
""" test config
"""
def prep_company(self):
""" get/create company
"""

View file

@ -3,7 +3,7 @@
# 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.tests.test_tryton import with_transaction
from trytond.pool import Pool
from trytond.modules.cashbook.model import CACHEKEY_CURRENCY, ENABLE_CACHE
from datetime import date
@ -11,10 +11,9 @@ from decimal import Decimal
import time
class CurrencyTestCase(ModuleTestCase):
'Test cache for currency'
module = 'cashbook'
class CurrencyTestCase(object):
""" test currency
"""
@with_transaction()
def test_currency_update_cache(self):
""" add/update/del rate of currency, check cache

View file

@ -3,17 +3,16 @@
# 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.tests.test_tryton import with_transaction
from trytond.pool import Pool
from trytond.exceptions import UserError
from datetime import date
from decimal import Decimal
class ReconTestCase(ModuleTestCase):
'Test cashbook reconciliation module'
module = 'cashbook'
class ReconTestCase(object):
""" test reconciliation
"""
@with_transaction()
def test_recon_check_overlap_start(self):
""" create, check deny of overlap date - date_from

View file

@ -3,15 +3,15 @@
# 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.tests.test_tryton import with_transaction
from trytond.pool import Pool
from datetime import date
from decimal import Decimal
class SplitLineTestCase(ModuleTestCase):
'Test split line module'
module = 'cashbook'
class SplitLineTestCase(object):
""" test split lines
"""
@with_transaction()
def test_splitline_in_category(self):