Remove unrequired XML files from tests module registration

This commit is contained in:
Nicolas Évrard committed 2026-02-24 22:37:16 +01:00
1 parent 385bce6315
commit 4e3ac1e465
5 files changed
+41 -3

No files matched your search

+5
View File
@@ -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')
+5 -1
View File
@@ -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')
+17
View File
@@ -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')
+14
View File
@@ -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')
-2
View File
@@ -3,10 +3,8 @@ depends:
ir
res
xml:
sequence.xml
workflow.xml
wizard.xml
report.xml
modelview.xml
field_function.xml
message.xml