diff --git a/trytond/trytond/tests/test_chat.py b/trytond/trytond/tests/test_chat.py index f352408dd5..d166cc32c8 100644 --- a/trytond/trytond/tests/test_chat.py +++ b/trytond/trytond/tests/test_chat.py @@ -5,7 +5,9 @@ from email.message import EmailMessage from email.utils import getaddresses from unittest.mock import patch +from trytond.convert import import_xml from trytond.pool import Pool +from trytond.tools import file_open from trytond.transaction import Transaction from .test_tryton import TestCase, activate_module, with_transaction @@ -30,6 +32,9 @@ class NotificationTestCase(TestCase): @with_transaction() def test_chat_post(self): "Test posting on chat" + with file_open('message.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() User = pool.get('res.user') Room = pool.get('test.chat.room') diff --git a/trytond/trytond/tests/test_ir.py b/trytond/trytond/tests/test_ir.py index f05658d0d1..1008ecf21c 100644 --- a/trytond/trytond/tests/test_ir.py +++ b/trytond/trytond/tests/test_ir.py @@ -17,11 +17,12 @@ except ImportError: from dateutil.relativedelta import relativedelta +from trytond.convert import import_xml from trytond.ir.exceptions import SequenceAffixError from trytond.ir.lang import _replace from trytond.pool import Pool from trytond.pyson import Eval, If, PYSONEncoder -from trytond.tools import timezone +from trytond.tools import file_open, timezone from trytond.transaction import Transaction from .test_tryton import ( @@ -99,6 +100,9 @@ class IrTestCase(ModuleTestCase): @with_transaction() def test_sequence_substitutions(self): 'Test Sequence Substitutions' + with file_open('sequence.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() Sequence = pool.get('ir.sequence') SequenceType = pool.get('ir.sequence.type') diff --git a/trytond/trytond/tests/test_report.py b/trytond/trytond/tests/test_report.py index aa9993f53f..48962dbeb6 100644 --- a/trytond/trytond/tests/test_report.py +++ b/trytond/trytond/tests/test_report.py @@ -11,11 +11,13 @@ try: except ImportError: mrml = None +from trytond.convert import import_xml from trytond.model.exceptions import AccessError from trytond.pool import Pool from trytond.report.report import Report, get_email from trytond.tests.test_tryton import ( TestCase, activate_module, with_transaction) +from trytond.tools import file_open from trytond.transaction import Transaction @@ -45,6 +47,9 @@ class ReportTestCase(TestCase): @with_transaction() def test_execute(self): "Execute report" + with file_open('report.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() Report = pool.get('test.test_report', type='report') @@ -55,6 +60,9 @@ class ReportTestCase(TestCase): @with_transaction() def test_execute_without_access(self): "Execute report without model access" + with file_open('report.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() ActionReport = pool.get('ir.action.report') Group = pool.get('res.group') @@ -74,6 +82,9 @@ class ReportTestCase(TestCase): @with_transaction() def test_execute_without_model_access(self): "Execute report without model access" + with file_open('report.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() Report = pool.get('test.test_report', type='report') ModelAccess = pool.get('ir.model.access') @@ -88,6 +99,9 @@ class ReportTestCase(TestCase): @with_transaction() def test_execute_without_read_access(self): "Execute report without read access" + with file_open('report.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() Report = pool.get('test.test_report', type='report') Model = pool.get('test.access') @@ -112,6 +126,9 @@ class ReportTestCase(TestCase): @with_transaction() def test_convert_mjml_to_html(self): "Test convert MJML to HTML" + with file_open('report.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() Report = pool.get('test.test_report_mjml', type='report') diff --git a/trytond/trytond/tests/test_sequence.py b/trytond/trytond/tests/test_sequence.py index fe60160532..6a8a509a67 100644 --- a/trytond/trytond/tests/test_sequence.py +++ b/trytond/trytond/tests/test_sequence.py @@ -3,10 +3,12 @@ # this repository contains the full copyright notices and license terms. import datetime +from trytond.convert import import_xml from trytond.ir.sequence import LastTimestampError from trytond.pool import Pool from trytond.tests.test_tryton import ( TestCase, activate_module, with_transaction) +from trytond.tools import file_open from trytond.transaction import Transaction @@ -26,6 +28,9 @@ class SequenceTestCase(TestCase): @with_transaction() def test_incremental(self): 'Test incremental' + with file_open('sequence.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() Sequence = self.get_model() SequenceType = pool.get('ir.sequence.type') @@ -63,6 +68,9 @@ class SequenceTestCase(TestCase): @with_transaction() def test_decimal_timestamp(self): 'Test Decimal Timestamp' + with file_open('sequence.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() Sequence = self.get_model() SequenceType = pool.get('ir.sequence.type') @@ -93,6 +101,9 @@ class SequenceTestCase(TestCase): @with_transaction() def test_hexadecimal_timestamp(self): 'Test Hexadecimal Timestamp' + with file_open('sequence.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() Sequence = self.get_model() SequenceType = pool.get('ir.sequence.type') @@ -124,6 +135,9 @@ class SequenceTestCase(TestCase): @with_transaction() def test_prefix_suffix(self): 'Test prefix/suffix' + with file_open('sequence.xml', subdir='tests') as xml: + import_xml(xml) + pool = Pool() Sequence = self.get_model() SequenceType = pool.get('ir.sequence.type') diff --git a/trytond/trytond/tests/tryton.cfg b/trytond/trytond/tests/tryton.cfg index 3880607899..db85c65789 100644 --- a/trytond/trytond/tests/tryton.cfg +++ b/trytond/trytond/tests/tryton.cfg @@ -3,10 +3,8 @@ depends: ir res xml: - sequence.xml workflow.xml wizard.xml - report.xml modelview.xml field_function.xml message.xml