[IMP] tests: deprecate SavepointCase

closes odoo/odoo#62031

Related: odoo/enterprise#14872
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
This commit is contained in:
Raphael Collet
2020-11-24 13:23:32 +00:00
parent 84aabd001e
commit 1398b6b44c
58 changed files with 118 additions and 104 deletions
+3 -3
View File
@@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields
from odoo.tests.common import SavepointCase, HttpSavepointCase, tagged, Form
from odoo.tests.common import TransactionCase, HttpCase, tagged, Form
import time
import base64
from lxml import etree
@tagged('post_install', '-at_install')
class AccountTestInvoicingCommon(SavepointCase):
class AccountTestInvoicingCommon(TransactionCase):
@classmethod
def copy_account(cls, account):
@@ -487,7 +487,7 @@ class AccountTestInvoicingCommon(SavepointCase):
@tagged('post_install', '-at_install')
class AccountTestInvoicingHttpCommon(AccountTestInvoicingCommon, HttpSavepointCase):
class AccountTestInvoicingHttpCommon(AccountTestInvoicingCommon, HttpCase):
pass
+1 -1
View File
@@ -4,7 +4,7 @@
from odoo.tests import common
class TestFiscalPosition(common.SavepointCase):
class TestFiscalPosition(common.TransactionCase):
"""Tests for fiscal positions in auto apply (account.fiscal.position).
If a partner has a vat number, the fiscal positions with "vat_required=True"
are preferred.
@@ -2,10 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class TestStreetFields(SavepointCase):
class TestStreetFields(TransactionCase):
@classmethod
def setUpClass(cls):
+2 -2
View File
@@ -3,11 +3,11 @@
from datetime import datetime
from odoo.tests.common import SavepointCase, new_test_user
from odoo.tests.common import TransactionCase, new_test_user
from odoo.exceptions import AccessError
class TestAccessRights(SavepointCase):
class TestAccessRights(TransactionCase):
@classmethod
def setUpClass(cls):
+2 -2
View File
@@ -3,10 +3,10 @@
from datetime import datetime
from odoo.tests.common import SavepointCase, new_test_user
from odoo.tests.common import TransactionCase, new_test_user
class TestEventNotifications(SavepointCase):
class TestEventNotifications(TransactionCase):
@classmethod
def setUpClass(cls):
@@ -6,11 +6,11 @@ from datetime import datetime, date
from dateutil.relativedelta import relativedelta
from odoo import fields
from odoo.tests.common import SavepointCase, new_test_user
from odoo.tests.common import TransactionCase, new_test_user
from odoo.addons.mail.tests.common import MailCase
class TestEventNotifications(SavepointCase, MailCase):
class TestEventNotifications(TransactionCase, MailCase):
@classmethod
def setUpClass(cls):
@@ -6,10 +6,10 @@ import pytz
from datetime import datetime, date
from dateutil.relativedelta import relativedelta
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class TestRecurrentEvents(SavepointCase):
class TestRecurrentEvents(TransactionCase):
@classmethod
def setUpClass(cls):
+1 -1
View File
@@ -8,7 +8,7 @@ from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.tests import common
class TestEventCommon(common.SavepointCase):
class TestEventCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
+1 -1
View File
@@ -3,7 +3,7 @@
from odoo.tests import common, new_test_user
class TestFleet(common.SavepointCase):
class TestFleet(common.TransactionCase):
def test_manager_create_vehicle(self):
manager = new_test_user(self.env, "test fleet manager", groups="fleet.fleet_group_manager,base.group_partner_manager")
@@ -10,7 +10,7 @@ from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.tests import common
class TestKarmaTrackingCommon(common.SavepointCase):
class TestKarmaTrackingCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
@@ -194,7 +194,7 @@ class TestKarmaTrackingCommon(common.SavepointCase):
self.assertEqual(user.karma_tracking_ids[0].new_value, 32)
class TestComputeRankCommon(common.SavepointCase):
class TestComputeRankCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
@@ -4,10 +4,10 @@
from odoo.addons.google_calendar.utils.google_calendar import GoogleEvent
import pytz
from datetime import datetime, date
from odoo.tests.common import SavepointCase, new_test_user
from odoo.tests.common import TransactionCase, new_test_user
class TestSyncGoogle2Odoo(SavepointCase):
class TestSyncGoogle2Odoo(TransactionCase):
@property
def now(self):
@@ -5,7 +5,7 @@ from datetime import datetime, date
from dateutil.relativedelta import relativedelta
from unittest.mock import MagicMock, patch
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from odoo.addons.google_calendar.utils.google_calendar import GoogleCalendarService
from odoo.addons.google_calendar.models.res_users import User
from odoo.addons.google_calendar.models.google_sync import GoogleSync
@@ -22,7 +22,7 @@ def patch_api(func):
return patched
@patch.object(User, '_get_google_calendar_token', lambda user: 'dummy-token')
class TestSyncOdoo2Google(SavepointCase):
class TestSyncOdoo2Google(TransactionCase):
def setUp(self):
super().setUp()
+2 -2
View File
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class TestContractCommon(SavepointCase):
class TestContractCommon(TransactionCase):
@classmethod
def setUpClass(cls):
@@ -4,11 +4,11 @@
from datetime import date, datetime
from odoo.tests import tagged
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
@tagged('company_leave')
class TestCompanyLeave(SavepointCase):
class TestCompanyLeave(TransactionCase):
""" Test leaves for a whole company, conflict resolutions """
@classmethod
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import common
from odoo.tests.common import Form, SavepointCase
from odoo.tests.common import Form, TransactionCase
CH_ISR_ISSUER = '01-162-8'
@@ -11,7 +11,7 @@ CH_POST_IBAN = 'CH09 0900 0000 1000 8060 7'
CH_POSTAL_ACC = '10-8060-7'
class TestOnchangePostal(SavepointCase):
class TestOnchangePostal(TransactionCase):
@classmethod
def setUpClass(cls):
+1 -1
View File
@@ -13,7 +13,7 @@ ISR_REFERENCE_NO_ZEROS = "1 23456 78903"
ISR_REFERENCE_BAD = "11 11111 11111 11111 11111 11111"
class TestVendorBillISR(common.SavepointCase):
class TestVendorBillISR(common.TransactionCase):
"""Check we can encode Vendor bills with ISR references
The ISR is a structured reference with a checksum.
+1 -1
View File
@@ -645,7 +645,7 @@ class MailCase(MockEmail):
self.assertEqual(1, 0)
class MailCommon(common.SavepointCase, MailCase):
class MailCommon(common.TransactionCase, MailCase):
""" Almost-void class definition setting the savepoint case + mock of mail.
Used mainly for class inheritance in other applications and test modules. """
@@ -4,11 +4,11 @@
from odoo.addons.microsoft_calendar.utils.microsoft_calendar import MicrosoftEvent
import pytz
from datetime import datetime, date
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from dateutil.relativedelta import relativedelta
class TestSyncMicrosoft2Odoo(SavepointCase):
class TestSyncMicrosoft2Odoo(TransactionCase):
@property
def now(self):
+2 -2
View File
@@ -3,7 +3,7 @@
from odoo.addons.mrp.tests.common import TestMrpCommon
from odoo.tests import Form
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class TestMrpProductionBackorder(TestMrpCommon):
@@ -281,7 +281,7 @@ class TestMrpProductionBackorder(TestMrpCommon):
self.assertEqual(len(production.procurement_group_id.mrp_production_ids), nb_product_todo)
class TestMrpWorkorderBackorder(SavepointCase):
class TestMrpWorkorderBackorder(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestMrpWorkorderBackorder, cls).setUpClass()
+2 -2
View File
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import Form, SavepointCase
from odoo.tests.common import Form, TransactionCase
class TestMrpSubcontractingCommon(SavepointCase):
class TestMrpSubcontractingCommon(TransactionCase):
@classmethod
def setUpClass(cls):
+1 -1
View File
@@ -3,7 +3,7 @@ from random import randint
from odoo import fields, tools
from odoo.addons.stock_account.tests.test_anglo_saxon_valuation_reconciliation_common import ValuationReconciliationTestCommon
from odoo.tests.common import SavepointCase, Form
from odoo.tests.common import Form
from odoo.tests import tagged
+2 -2
View File
@@ -3,7 +3,7 @@
from odoo.tests import common
class TestProductCommon(common.SavepointCase):
class TestProductCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
@@ -102,7 +102,7 @@ class TestProductCommon(common.SavepointCase):
'uom_po_id': cls.uom_unit.id})
class TestAttributesCommon(common.SavepointCase):
class TestAttributesCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
@@ -6,11 +6,11 @@ from psycopg2 import IntegrityError
from odoo.exceptions import UserError, ValidationError
from odoo.tests import tagged
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from odoo.tools import mute_logger
class TestProductAttributeValueCommon(SavepointCase):
class TestProductAttributeValueCommon(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestProductAttributeValueCommon, cls).setUpClass()
+2 -2
View File
@@ -2,11 +2,11 @@
from contextlib import contextmanager
from odoo.tests.common import SavepointCase, Form
from odoo.tests.common import TransactionCase, Form
from odoo.exceptions import AccessError, UserError
class TestMultiCompanyCommon(SavepointCase):
class TestMultiCompanyCommon(TransactionCase):
@classmethod
def setUpMultiCompany(cls):
+2 -2
View File
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from odoo.exceptions import UserError
class TestProjectCommon(SavepointCase):
class TestProjectCommon(TransactionCase):
@classmethod
def setUpClass(cls):
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from odoo.tests.common import SavepointCase, Form
from odoo.tests.common import TransactionCase, Form
from odoo.exceptions import ValidationError
from odoo import fields
@@ -10,7 +10,7 @@ from dateutil.rrule import MO, TU, WE, TH, FR, SA, SU
from unittest.mock import patch
class TestProjectrecurrence(SavepointCase):
class TestProjectrecurrence(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestProjectrecurrence, cls).setUpClass()
+1 -1
View File
@@ -3,7 +3,7 @@
from odoo.tests import common
class TestPurchaseRequisitionCommon(common.SavepointCase):
class TestPurchaseRequisitionCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
@@ -6,10 +6,10 @@ from datetime import timedelta as td
from odoo import SUPERUSER_ID
from odoo.tests import Form
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class TestReorderingRule(SavepointCase):
class TestReorderingRule(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestReorderingRule, cls).setUpClass()
+1 -1
View File
@@ -8,7 +8,7 @@ from odoo.tools import mute_logger
@tagged('security')
class TestAccessRating(common.SavepointCase):
class TestAccessRating(common.TransactionCase):
@classmethod
def setUpClass(cls):
+2 -2
View File
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.addons.base.tests.common import SavepointCase
from odoo.addons.base.tests.common import TransactionCase
class TestSaleCommonBase(SavepointCase):
class TestSaleCommonBase(TransactionCase):
''' Setup with sale test configuration. '''
@classmethod
@@ -1,11 +1,11 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from odoo.modules.module import get_module_resource
class TestProductConfiguratorCommon(SavepointCase):
class TestProductConfiguratorCommon(TransactionCase):
@classmethod
def setUpClass(cls):
@@ -6,7 +6,7 @@ from .common import TestProductConfiguratorCommon
@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpSavepointCase, TestProductConfiguratorCommon):
class TestUi(odoo.tests.HttpCase, TestProductConfiguratorCommon):
def setUp(self):
super(TestUi, self).setUp()
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details
from odoo.tests.common import SavepointCase, new_test_user
from odoo.tests.common import TransactionCase, new_test_user
class TestNestedTaskUpdate(SavepointCase):
class TestNestedTaskUpdate(TransactionCase):
@classmethod
def setUpClass(cls):
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class TestSaleProject(SavepointCase):
class TestSaleProject(TransactionCase):
@classmethod
def setUpClass(cls):
+2 -2
View File
@@ -2,10 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class TestSalesCommon(SavepointCase):
class TestSalesCommon(TransactionCase):
@classmethod
def setUpClass(cls):
+1 -1
View File
@@ -3,7 +3,7 @@
from odoo.tests import common
class TestStockCommon(common.SavepointCase):
class TestStockCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
super(TestStockCommon, cls).setUpClass()
@@ -2,10 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import UserError, ValidationError
from odoo.tests.common import Form, SavepointCase
from odoo.tests.common import Form, TransactionCase
class StockGenerate(SavepointCase):
class StockGenerate(TransactionCase):
@classmethod
def setUpClass(cls):
super(StockGenerate, cls).setUpClass()
+2 -2
View File
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import ValidationError
from odoo.tests.common import Form, SavepointCase
from odoo.tests.common import Form, TransactionCase
class TestInventory(SavepointCase):
class TestInventory(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestInventory, cls).setUpClass()
+2 -2
View File
@@ -3,10 +3,10 @@
from odoo.exceptions import UserError
from odoo.tests import Form
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class StockMove(SavepointCase):
class StockMove(TransactionCase):
@classmethod
def setUpClass(cls):
super(StockMove, cls).setUpClass()
+2 -2
View File
@@ -2,10 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import UserError
from odoo.tests.common import SavepointCase, Form
from odoo.tests.common import TransactionCase, Form
class TestMultiCompany(SavepointCase):
class TestMultiCompany(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestMultiCompany, cls).setUpClass()
+2 -2
View File
@@ -2,12 +2,12 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import Form
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from odoo.tools import float_round
from odoo.exceptions import UserError
class TestPackingCommon(SavepointCase):
class TestPackingCommon(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestPackingCommon, cls).setUpClass()
+2 -2
View File
@@ -6,11 +6,11 @@ from datetime import datetime, timedelta
from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.exceptions import ValidationError
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from odoo.exceptions import AccessError, UserError
class StockQuant(SavepointCase):
class StockQuant(TransactionCase):
@classmethod
def setUpClass(cls):
super(StockQuant, cls).setUpClass()
@@ -2,11 +2,11 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
from odoo.exceptions import AccessError, UserError
class TestEditableQuant(SavepointCase):
class TestEditableQuant(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestEditableQuant, cls).setUpClass()
+2 -2
View File
@@ -3,10 +3,10 @@
from datetime import date, datetime, timedelta
from odoo.tests.common import Form, SavepointCase
from odoo.tests.common import Form, TransactionCase
class TestReportsCommon(SavepointCase):
class TestReportsCommon(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
+2 -2
View File
@@ -2,10 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import UserError, ValidationError
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class TestRobustness(SavepointCase):
class TestRobustness(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestRobustness, cls).setUpClass()
@@ -5,7 +5,7 @@ from datetime import timedelta
from odoo.exceptions import UserError
from odoo.fields import Datetime
from odoo.tests.common import Form, SavepointCase
from odoo.tests.common import Form, TransactionCase
def _create_accounting_data(env):
@@ -46,7 +46,7 @@ def _create_accounting_data(env):
return stock_input_account, stock_output_account, stock_valuation_account, expense_account, stock_journal
class TestStockValuation(SavepointCase):
class TestStockValuation(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestStockValuation, cls).setUpClass()
@@ -5,10 +5,10 @@
from odoo.addons.stock_account.tests.test_stockvaluation import _create_accounting_data
from odoo.tests import Form, tagged
from odoo.tests.common import SavepointCase, TransactionCase
from odoo.tests.common import TransactionCase
class TestStockValuationCommon(SavepointCase):
class TestStockValuationCommon(TransactionCase):
@classmethod
def setUpClass(cls):
super(TestStockValuationCommon, cls).setUpClass()
+1 -1
View File
@@ -10,7 +10,7 @@ from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.tests import common
class SurveyCase(common.SavepointCase):
class SurveyCase(common.TransactionCase):
def setUp(self):
super(SurveyCase, self).setUp()
+2 -2
View File
@@ -2,7 +2,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.mail.tests.common import MailCommon
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class TestMailCommon(MailCommon):
@@ -23,7 +23,7 @@ class TestMailMultiCompanyCommon(MailCommon):
})
class TestRecipients(SavepointCase):
class TestRecipients(TransactionCase):
@classmethod
def setUpClass(cls):
+2 -2
View File
@@ -7,10 +7,10 @@ from unittest.mock import patch
from odoo.addons.event.tests.common import TestEventCommon
from odoo.addons.mail.tests.common import mail_new_test_user
from odoo.fields import Datetime as FieldsDatetime, Date as FieldsDate
from odoo.tests.common import SavepointCase
from odoo.tests.common import TransactionCase
class EventDtPatcher(SavepointCase):
class EventDtPatcher(TransactionCase):
@classmethod
def setUpClass(cls):
+1 -1
View File
@@ -18,7 +18,7 @@ KARMA = {
}
class TestForumCommon(common.SavepointCase):
class TestForumCommon(common.TransactionCase):
@classmethod
def setUpClass(cls):
@@ -1,12 +1,12 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import HttpSavepointCase
from odoo.tests.common import HttpCase
from odoo.addons.sale_product_configurator.tests.common import TestProductConfiguratorCommon
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class TestUi(HttpSavepointCase, TestProductConfiguratorCommon):
class TestUi(HttpCase, TestProductConfiguratorCommon):
def test_01_admin_shop_custom_attribute_value_tour(self):
# fix runbot, sometimes one pricelist is chosen, sometimes the other...
+1 -1
View File
@@ -5,7 +5,7 @@ from odoo.tests import common
from odoo.addons.mail.tests.common import mail_new_test_user
class SlidesCase(common.SavepointCase):
class SlidesCase(common.TransactionCase):
@classmethod
def setUpClass(cls):
+2 -2
View File
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import SavepointCase, TransactionCase, HttpCase
from odoo.tests.common import TransactionCase, HttpCase
class TransactionCaseWithUserDemo(TransactionCase):
@@ -52,7 +52,7 @@ class HttpCaseWithUserDemo(HttpCase):
})
class SavepointCaseWithUserDemo(SavepointCase):
class SavepointCaseWithUserDemo(TransactionCase):
@classmethod
def setUpClass(cls):
+2 -2
View File
@@ -4,7 +4,7 @@
from psycopg2 import IntegrityError
from odoo.exceptions import ValidationError
from odoo.tests.common import TransactionCase, SavepointCase, tagged
from odoo.tests.common import TransactionCase, tagged
from odoo.tools import mute_logger
@@ -172,7 +172,7 @@ class TestXMLID(TransactionCase):
model._load_records(data_list)
class TestIrModel(SavepointCase):
class TestIrModel(TransactionCase):
@classmethod
def setUpClass(cls):
+2 -2
View File
@@ -8,7 +8,7 @@ import email.message
import re
import threading
from odoo.tests.common import BaseCase, SavepointCase, TransactionCase
from odoo.tests.common import BaseCase, TransactionCase
from odoo.tools import (
is_html_empty, html_sanitize, append_content_to_html, plaintext2html,
email_split,
@@ -426,7 +426,7 @@ class TestEmailTools(BaseCase):
self.assertEqual(formataddr(pair, charset), expected)
class EmailConfigCase(SavepointCase):
class EmailConfigCase(TransactionCase):
@patch.dict("odoo.tools.config.options", {"email_from": "settings@example.com"})
def test_default_email_from(self, *args):
"""Email from setting is respected."""
+1 -1
View File
@@ -2373,7 +2373,7 @@ class TestViews(ViewCase):
self.assertIn(expected_message, message)
class TestViewTranslations(common.SavepointCase):
class TestViewTranslations(common.TransactionCase):
# these tests are essentially the same as in test_translate.py, but they use
# the computed field 'arch' instead of the translated field 'arch_db'
+17 -3
View File
@@ -27,6 +27,7 @@ import threading
import time
import unittest
import difflib
import warnings
import werkzeug.urls
from contextlib import contextmanager
from datetime import datetime, date
@@ -635,8 +636,14 @@ class TransactionCase(BaseCase):
self.patch(self.registry['res.partner'], '_get_gravatar_image', lambda *a: False)
# kept for backward compatibility
SavepointCase = TransactionCase
class SavepointCase(TransactionCase):
@classmethod
def __init_subclass__(cls):
super().__init_subclass__()
warnings.warn(
"Deprecated class SavepointCase has been merged into TransactionCase",
DeprecationWarning, stacklevel=2,
)
class SingleTransactionCase(BaseCase):
@@ -1433,7 +1440,14 @@ class HttpCase(TransactionCase):
# kept for backward compatibility
HttpSavepointCase = HttpCase
class HttpSavepointCase(HttpCase):
@classmethod
def __init_subclass__(cls):
super().__init_subclass__()
warnings.warn(
"Deprecated class HttpSavepointCase has been merged into HttpCase",
DeprecationWarning, stacklevel=2,
)
def users(*logins):