changeset b212e77a3c33 in modules/company:default
details: https://hg.tryton.org/modules/company?cmd=changeset;node=b212e77a3c33
description:
Add generic test for check erase party
issue9895
review324571002
diffstat:
tests/__init__.py | 10 +++++++---
tests/test_company.py | 10 +++++++++-
2 files changed, 16 insertions(+), 4 deletions(-)
diffs (47 lines):
diff -r 6435067d278a -r b212e77a3c33 tests/__init__.py
--- a/tests/__init__.py Mon Nov 02 15:57:59 2020 +0100
+++ b/tests/__init__.py Sat Dec 05 11:53:48 2020 +0100
@@ -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']
diff -r 6435067d278a -r b212e77a3c33 tests/test_company.py
--- a/tests/test_company.py Mon Nov 02 15:57:59 2020 +0100
+++ b/tests/test_company.py Sat Dec 05 11:53:48 2020 +0100
@@ -9,6 +9,7 @@
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 @@
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'