mirror of
https://github.com/OCA/intrastat-extrastat.git
synced 2025-02-16 17:13:41 +02:00
intrastat_base: Remove intrastat.common class
This commit is contained in:
@@ -1,45 +1,8 @@
|
||||
# Copyright 2021 ACSONE SA/NV
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from odoo_test_helper import FakeModelLoader
|
||||
|
||||
from odoo.modules.module import get_resource_path
|
||||
from odoo.tools import convert_file
|
||||
|
||||
|
||||
class IntrastatCommon(object):
|
||||
@classmethod
|
||||
def _load_xml(cls, module, filepath):
|
||||
convert_file(
|
||||
cls.env.cr,
|
||||
module,
|
||||
get_resource_path(module, filepath),
|
||||
{},
|
||||
mode="init",
|
||||
noupdate=False,
|
||||
kind="test",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def _load_test_declaration(cls):
|
||||
cls.loader = FakeModelLoader(cls.env, cls.__module__)
|
||||
cls.loader.backup_registry()
|
||||
|
||||
# The fake class is imported here !! After the backup_registry
|
||||
from .models import IntrastatDeclarationTest
|
||||
|
||||
cls.loader.update_registry((IntrastatDeclarationTest,))
|
||||
|
||||
@classmethod
|
||||
def _create_declaration(cls, vals=None):
|
||||
values = {
|
||||
"company_id": cls.declaration_test_obj._default_company_id().id,
|
||||
"year": "2021",
|
||||
"month": "03",
|
||||
}
|
||||
if vals is not None:
|
||||
values.update(vals)
|
||||
cls.declaration = cls.declaration_test_obj.create(values)
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
@@ -51,9 +14,3 @@ class IntrastatCommon(object):
|
||||
cls.demo_company = cls.env.ref("base.main_company")
|
||||
|
||||
cls.shipping_cost = cls.env.ref("intrastat_base.shipping_costs_exclude")
|
||||
cls._load_test_declaration()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
cls.loader.restore_registry()
|
||||
super().tearDownClass()
|
||||
|
||||
Reference in New Issue
Block a user