Add generic test for check erase party

issue9895
review324571002
This commit is contained in:
Cédric Krier committed 2020-12-05 11:53:48 +01:00
1 parent a33cfaedfe
commit ea17d1bbe7
2 files changed
+16 -4

No files matched your search

+7 -3
View File
@@ -3,9 +3,13 @@
try:
from trytond.modules.company.tests.test_company import (
suite, create_company, set_company, create_employee)
suite, create_company, set_company, create_employee,
PartyCompanyCheckEraseMixin)
except ImportError:
from .test_company import (
suite, create_company, set_company, create_employee)
suite, create_company, set_company, create_employee,
PartyCompanyCheckEraseMixin)
__all__ = ['suite', 'create_company', 'set_company', 'create_employee']
__all__ = [
'suite', 'create_company', 'set_company', 'create_employee',
'PartyCompanyCheckEraseMixin']
+9 -1
View File
@@ -9,6 +9,7 @@ from trytond.transaction import Transaction
from trytond.pool import Pool
from trytond.modules.currency.tests import create_currency, add_currency_rate
from trytond.modules.party.tests import PartyCheckEraseMixin
def create_company(name='Dunder Mifflin', currency=None):
@@ -55,7 +56,14 @@ def set_company(company):
yield
class CompanyTestCase(ModuleTestCase):
class PartyCompanyCheckEraseMixin(PartyCheckEraseMixin):
def setup_check_erase_party(self):
create_company()
return super().setup_check_erase_party()
class CompanyTestCase(PartyCompanyCheckEraseMixin, ModuleTestCase):
'Test Company module'
module = 'company'