summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorChristophe Monniez <moc@odoo.com>2017-08-21 08:36:35 +0200
committerChristophe Monniez <moc@odoo.com>2018-01-18 13:20:37 +0100
commitb356b190338e3ee032b9e3a7f670f76468965006 (patch)
treef32b334a7a7a467646e778d9f93a70a262f5b626 /addons
parent079e1a0c312ea6ed66ed42676b25b6ac22db2b58 (diff)
[IMP] tests: Add the possibility to tag tests
Purpose: When running tests, all the tests for the installed/updated files are done. This commit adds a 'tagged' decorator that can be used to tag tests. Combined with a new 'test-tags' CLI option, it adds the ability to filter which tests are executed. For example, @tagged('slow') will add a tag 'slow' to the test. The CLI option 'test-tags="slow"' will only run tests tagged 'slow'. One can use prefixes to select cases with tags. '+' or no prefix means that the tests tagged with this tag are selected for execution. '-' prefix will exclude the tests tagged with this tag. Exclusion takes precedence over inclusion. Also, by default, all Odoo tests cases are tagged 'standard' and with the technical name of the module. This means that when selecting tests with the 'test-tags' parameter, if '-standard' is not specified, all tests tags are going to be executed. When tagging tests, one can remove such automatic tag by prefixing the tag name with '-'. E.g. @tagged('-standard') will remove the standard tag from the test. Another example, if one wants to test the 'sale' module alone, even without adding any 'tagged' decorator thos tests can be selected like that: --test-tags="sale" Tests are selected or deselected using a TagsSelector. When instanciated, a string is passed with comma separated tests selectors like '+slow,-standard'. When the 'check' method is called with a test as argument, it returns True or False if the test has to be executed or not.
Diffstat (limited to 'addons')
-rw-r--r--addons/account/tests/account_test_classes.py6
-rw-r--r--addons/account/tests/test_account_customer_invoice.py2
-rw-r--r--addons/account/tests/test_account_invoice_rounding.py2
-rw-r--r--addons/account/tests/test_account_move_closed_period.py3
-rw-r--r--addons/account/tests/test_account_supplier_invoice.py3
-rw-r--r--addons/account/tests/test_account_validate_account_move.py3
-rw-r--r--addons/account/tests/test_bank_statement_reconciliation.py3
-rw-r--r--addons/account/tests/test_bank_stmt_reconciliation_widget_ui.py5
-rw-r--r--addons/account/tests/test_manual_reconciliation.py3
-rw-r--r--addons/account/tests/test_payment.py3
-rw-r--r--addons/account/tests/test_product_id_change.py3
-rw-r--r--addons/account/tests/test_reconciliation.py2
-rw-r--r--addons/account/tests/test_search.py2
-rw-r--r--addons/account/tests/test_setup_bar.py3
-rw-r--r--addons/account/tests/test_tax.py2
-rw-r--r--addons/account_budget/tests/common.py1
-rw-r--r--addons/account_budget/tests/test_account_budget.py2
-rw-r--r--addons/account_budget/tests/test_theoreticalamount.py2
-rw-r--r--addons/base_automation/tests/test_base_automation.py3
-rw-r--r--addons/crm/tests/test_crm_ui.py3
-rw-r--r--addons/delivery/tests/test_delivery_cost.py3
-rw-r--r--addons/delivery/tests/test_delivery_stock_move.py2
-rw-r--r--addons/l10n_ch/tests/test_l10n_ch_isr.py2
-rw-r--r--addons/membership/tests/test_membership.py2
-rw-r--r--addons/payment_authorize/tests/test_authorize.py13
-rw-r--r--addons/payment_buckaroo/tests/test_buckaroo.py6
-rw-r--r--addons/payment_stripe/tests/test_stripe.py9
-rw-r--r--addons/point_of_sale/tests/test_point_of_sale_flow.py3
-rw-r--r--addons/point_of_sale/tests/test_point_of_sale_ui.py3
-rw-r--r--addons/portal/tests/test_load_process.py3
-rw-r--r--addons/project/tests/test_project_ui.py3
-rw-r--r--addons/purchase/tests/test_purchase_order.py2
-rw-r--r--addons/repair/tests/test_repair.py2
-rw-r--r--addons/sale_expense/tests/test_sale_expense.py2
-rw-r--r--addons/sale_management/tests/test_sale_ui.py3
-rw-r--r--addons/sale_stock/tests/test_sale_stock.py2
-rw-r--r--addons/sale_timesheet/tests/test_timesheet_revenue.py2
-rw-r--r--addons/stock_landed_costs/tests/test_stock_landed_costs.py2
-rw-r--r--addons/stock_landed_costs/tests/test_stock_landed_costs_purchase.py3
-rw-r--r--addons/stock_landed_costs/tests/test_stock_landed_costs_rounding.py2
-rw-r--r--addons/survey/tests/test_survey_ui.py5
-rw-r--r--addons/web/tests/test_js.py5
-rw-r--r--addons/web/tests/test_menu.py3
-rw-r--r--addons/web/tests/test_serving_base.py2
-rw-r--r--addons/web_editor/tests/test_converter.py1
-rw-r--r--addons/web_editor/tests/test_ui.py6
-rw-r--r--addons/website/tests/test_converter.py3
-rw-r--r--addons/website/tests/test_crawl.py4
-rw-r--r--addons/website/tests/test_ui.py4
-rw-r--r--addons/website_blog/tests/test_ui.py3
-rw-r--r--addons/website_crm/tests/test_website_crm.py3
-rw-r--r--addons/website_event/tests/test_ui.py3
-rw-r--r--addons/website_event_sale/tests/test_ui.py4
-rw-r--r--addons/website_forum/tests/test_forum_process.py4
-rw-r--r--addons/website_hr_recruitment/tests/test_website_hr_recruitment.py3
-rw-r--r--addons/website_sale/tests/test_sale_process.py3
-rw-r--r--addons/website_sale_options/tests/test_customize.py4
57 files changed, 105 insertions, 80 deletions
diff --git a/addons/account/tests/account_test_classes.py b/addons/account/tests/account_test_classes.py
index 42ba9268187..c7aff306c02 100644
--- a/addons/account/tests/account_test_classes.py
+++ b/addons/account/tests/account_test_classes.py
@@ -3,9 +3,10 @@
import logging
_logger = logging.getLogger(__name__)
-from odoo.tests.common import HttpCase
+from odoo.tests.common import HttpCase, tagged
from odoo.exceptions import ValidationError
+
class AccountingTestCase(HttpCase):
""" This class extends the base TransactionCase, in order to test the
accounting with localization setups. It is configured to run the tests after
@@ -13,9 +14,6 @@ class AccountingTestCase(HttpCase):
configured accounting (which means no localization module has been installed).
"""
- post_install = True
- at_install = False
-
def setUp(self):
super(AccountingTestCase, self).setUp()
domain = [('company_id', '=', self.env.ref('base.main_company').id)]
diff --git a/addons/account/tests/test_account_customer_invoice.py b/addons/account/tests/test_account_customer_invoice.py
index 2f7142e67d2..b1743aa982f 100644
--- a/addons/account/tests/test_account_customer_invoice.py
+++ b/addons/account/tests/test_account_customer_invoice.py
@@ -1,7 +1,9 @@
from odoo.addons.account.tests.account_test_users import AccountTestUsers
import datetime
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestAccountCustomerInvoice(AccountTestUsers):
def test_customer_invoice(self):
diff --git a/addons/account/tests/test_account_invoice_rounding.py b/addons/account/tests/test_account_invoice_rounding.py
index 9b0ef0fc9e8..f0a7774d61d 100644
--- a/addons/account/tests/test_account_invoice_rounding.py
+++ b/addons/account/tests/test_account_invoice_rounding.py
@@ -2,10 +2,12 @@
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
from odoo.exceptions import ValidationError
+from odoo.tests import tagged
import time
+@tagged('post_install', '-at_install')
class TestAccountInvoiceRounding(AccountingTestCase):
def setUp(self):
diff --git a/addons/account/tests/test_account_move_closed_period.py b/addons/account/tests/test_account_move_closed_period.py
index f0b700247f8..298738a0d6c 100644
--- a/addons/account/tests/test_account_move_closed_period.py
+++ b/addons/account/tests/test_account_move_closed_period.py
@@ -2,7 +2,10 @@ from odoo.addons.account.tests.account_test_classes import AccountingTestCase
from odoo.osv.orm import except_orm
from datetime import datetime, timedelta
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
+from odoo.tests import tagged
+
+@tagged('post_install', '-at_install')
class TestPeriodState(AccountingTestCase):
"""
Forbid creation of Journal Entries for a closed period.
diff --git a/addons/account/tests/test_account_supplier_invoice.py b/addons/account/tests/test_account_supplier_invoice.py
index 357ac04f8f2..d6584ab6138 100644
--- a/addons/account/tests/test_account_supplier_invoice.py
+++ b/addons/account/tests/test_account_supplier_invoice.py
@@ -1,6 +1,9 @@
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
from odoo.exceptions import Warning
+
+@tagged('post_install', '-at_install')
class TestAccountSupplierInvoice(AccountingTestCase):
def test_supplier_invoice(self):
diff --git a/addons/account/tests/test_account_validate_account_move.py b/addons/account/tests/test_account_validate_account_move.py
index db59505af23..91e61fc0944 100644
--- a/addons/account/tests/test_account_validate_account_move.py
+++ b/addons/account/tests/test_account_validate_account_move.py
@@ -1,5 +1,8 @@
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
+
+@tagged('post_install', '-at_install')
class TestAccountValidateAccount(AccountingTestCase):
def test_account_validate_account(self):
diff --git a/addons/account/tests/test_bank_statement_reconciliation.py b/addons/account/tests/test_bank_statement_reconciliation.py
index 7932b32d1fc..4bf89f7a108 100644
--- a/addons/account/tests/test_bank_statement_reconciliation.py
+++ b/addons/account/tests/test_bank_statement_reconciliation.py
@@ -1,5 +1,8 @@
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
+
+@tagged('post_install', '-at_install')
class TestBankStatementReconciliation(AccountingTestCase):
def setUp(self):
diff --git a/addons/account/tests/test_bank_stmt_reconciliation_widget_ui.py b/addons/account/tests/test_bank_stmt_reconciliation_widget_ui.py
index 9db8bba061c..785ce234022 100644
--- a/addons/account/tests/test_bank_stmt_reconciliation_widget_ui.py
+++ b/addons/account/tests/test_bank_stmt_reconciliation_widget_ui.py
@@ -1,8 +1,7 @@
-from odoo.tests import HttpCase
+from odoo.tests import HttpCase, tagged
+@odoo.tests.tagged('post_install','-at_install')
class TestUi(HttpCase):
- post_install = True
- at_install = False
def test_01_admin_bank_statement_reconciliation(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('bank_statement_reconciliation', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.bank_statement_reconciliation", login="admin")
diff --git a/addons/account/tests/test_manual_reconciliation.py b/addons/account/tests/test_manual_reconciliation.py
index c9c286711f7..5f01f0165d7 100644
--- a/addons/account/tests/test_manual_reconciliation.py
+++ b/addons/account/tests/test_manual_reconciliation.py
@@ -1,5 +1,8 @@
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
+
+@tagged('post_install','-at_install')
class TestManualReconciliation(AccountingTestCase):
def test_reconciliation_proposition(self):
diff --git a/addons/account/tests/test_payment.py b/addons/account/tests/test_payment.py
index 457c76112e7..3e0e1c8961d 100644
--- a/addons/account/tests/test_payment.py
+++ b/addons/account/tests/test_payment.py
@@ -1,6 +1,9 @@
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
import time
+
+@tagged('post_install', '-at_install')
class TestPayment(AccountingTestCase):
def setUp(self):
diff --git a/addons/account/tests/test_product_id_change.py b/addons/account/tests/test_product_id_change.py
index 2aeb4309b9d..62f18772f6a 100644
--- a/addons/account/tests/test_product_id_change.py
+++ b/addons/account/tests/test_product_id_change.py
@@ -1,6 +1,9 @@
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
import time
+
+@tagged('post_install', '-at_install')
class TestProductIdChange(AccountingTestCase):
"""Test that when an included tax is mapped by a fiscal position, the included tax must be
subtracted to the price of the product.
diff --git a/addons/account/tests/test_reconciliation.py b/addons/account/tests/test_reconciliation.py
index b91d4748954..aa4fc950279 100644
--- a/addons/account/tests/test_reconciliation.py
+++ b/addons/account/tests/test_reconciliation.py
@@ -1,8 +1,10 @@
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
import time
import unittest
+@tagged('post_install', '-at_install')
class TestReconciliation(AccountingTestCase):
"""Tests for reconciliation (account.tax)
diff --git a/addons/account/tests/test_search.py b/addons/account/tests/test_search.py
index cc7f03e632e..5a80665558c 100644
--- a/addons/account/tests/test_search.py
+++ b/addons/account/tests/test_search.py
@@ -1,6 +1,8 @@
from odoo.addons.account.tests.account_test_users import AccountTestUsers
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestSearch(AccountTestUsers):
"""Tests for search on name_search (account.account)
diff --git a/addons/account/tests/test_setup_bar.py b/addons/account/tests/test_setup_bar.py
index ca260aef0fa..ccec27dcac5 100644
--- a/addons/account/tests/test_setup_bar.py
+++ b/addons/account/tests/test_setup_bar.py
@@ -2,7 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
+
+@tagged('post_install', '-at_install')
class TestSetupBar(AccountingTestCase):
def test_initial_balance_step(self):
diff --git a/addons/account/tests/test_tax.py b/addons/account/tests/test_tax.py
index 4ca0f8c6ab1..c8ac0683287 100644
--- a/addons/account/tests/test_tax.py
+++ b/addons/account/tests/test_tax.py
@@ -1,7 +1,9 @@
from odoo.addons.account.tests.account_test_users import AccountTestUsers
import time
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestTax(AccountTestUsers):
def setUp(self):
diff --git a/addons/account_budget/tests/common.py b/addons/account_budget/tests/common.py
index 36757dba6d8..1452f0f0d51 100644
--- a/addons/account_budget/tests/common.py
+++ b/addons/account_budget/tests/common.py
@@ -2,7 +2,6 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
-
import time
diff --git a/addons/account_budget/tests/test_account_budget.py b/addons/account_budget/tests/test_account_budget.py
index 690ae505942..758dc805339 100644
--- a/addons/account_budget/tests/test_account_budget.py
+++ b/addons/account_budget/tests/test_account_budget.py
@@ -3,12 +3,14 @@
from .common import TestAccountBudgetCommon
from odoo.fields import Date
+from odoo.tests import tagged
import datetime
# ---------------------------------------------------------
# Tests
# ---------------------------------------------------------
+@tagged('post_install', '-at_install')
class TestAccountBudget(TestAccountBudgetCommon):
def test_account_budget(self):
diff --git a/addons/account_budget/tests/test_theoreticalamount.py b/addons/account_budget/tests/test_theoreticalamount.py
index cde8f81a9b6..80f1ff6438a 100644
--- a/addons/account_budget/tests/test_theoreticalamount.py
+++ b/addons/account_budget/tests/test_theoreticalamount.py
@@ -8,10 +8,12 @@ except ImportError:
from mock import patch
from odoo.fields import Datetime
+from odoo.tests import tagged
# ---------------------------------------------------------
# Tests
# ---------------------------------------------------------
+@tagged('post_install', '-at_install')
class TestTheoreticalAmount(TestAccountBudgetCommon):
def setUp(self):
super(TestTheoreticalAmount, self).setUp()
diff --git a/addons/base_automation/tests/test_base_automation.py b/addons/base_automation/tests/test_base_automation.py
index 2bea32ec57c..d71423f4e69 100644
--- a/addons/base_automation/tests/test_base_automation.py
+++ b/addons/base_automation/tests/test_base_automation.py
@@ -4,8 +4,7 @@
from odoo.tests import common
-@common.at_install(False)
-@common.post_install(True)
+@common.tagged('post_install','-at_install')
class base_automation_test(common.TransactionCase):
def setUp(self):
diff --git a/addons/crm/tests/test_crm_ui.py b/addons/crm/tests/test_crm_ui.py
index 7df4c97b4f7..3c648a1a276 100644
--- a/addons/crm/tests/test_crm_ui.py
+++ b/addons/crm/tests/test_crm_ui.py
@@ -3,8 +3,7 @@
import odoo.tests
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install','-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_crm_tour(self):
diff --git a/addons/delivery/tests/test_delivery_cost.py b/addons/delivery/tests/test_delivery_cost.py
index 591f4ebb0bf..d027906ef6a 100644
--- a/addons/delivery/tests/test_delivery_cost.py
+++ b/addons/delivery/tests/test_delivery_cost.py
@@ -4,8 +4,7 @@ from odoo.tests import common
from odoo.tools import float_compare
-@common.at_install(False)
-@common.post_install(True)
+@common.tagged('post_install', '-at_install')
class TestDeliveryCost(common.TransactionCase):
def setUp(self):
diff --git a/addons/delivery/tests/test_delivery_stock_move.py b/addons/delivery/tests/test_delivery_stock_move.py
index 81e66e3314d..9ff51082fa9 100644
--- a/addons/delivery/tests/test_delivery_stock_move.py
+++ b/addons/delivery/tests/test_delivery_stock_move.py
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class StockMoveInvoice(AccountingTestCase):
def setUp(self):
diff --git a/addons/l10n_ch/tests/test_l10n_ch_isr.py b/addons/l10n_ch/tests/test_l10n_ch_isr.py
index c7722e1a7d0..980ad310b99 100644
--- a/addons/l10n_ch/tests/test_l10n_ch_isr.py
+++ b/addons/l10n_ch/tests/test_l10n_ch_isr.py
@@ -5,8 +5,10 @@ import time
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
from odoo.exceptions import ValidationError
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class ISRTest(AccountingTestCase):
def create_invoice(self, currency_to_use='base.CHF'):
diff --git a/addons/membership/tests/test_membership.py b/addons/membership/tests/test_membership.py
index d59bc0763ba..fa00f0d31c2 100644
--- a/addons/membership/tests/test_membership.py
+++ b/addons/membership/tests/test_membership.py
@@ -4,8 +4,10 @@ import datetime
from dateutil.relativedelta import relativedelta
from odoo.addons.membership.tests.common import TestMembershipCommon
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestMembership(TestMembershipCommon):
def test_old_membership(self):
diff --git a/addons/payment_authorize/tests/test_authorize.py b/addons/payment_authorize/tests/test_authorize.py
index 9e438deb76c..f903f05b759 100644
--- a/addons/payment_authorize/tests/test_authorize.py
+++ b/addons/payment_authorize/tests/test_authorize.py
@@ -3,9 +3,8 @@
import hashlib
import hmac
import time
-import unittest
-from lxml import objectify
from werkzeug import urls
+from lxml import objectify
import odoo
from odoo.addons.payment.models.payment_acquirer import ValidationError
@@ -14,8 +13,7 @@ from odoo.addons.payment_authorize.controllers.main import AuthorizeController
from odoo.tools import mute_logger
-@odoo.tests.common.at_install(True)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class AuthorizeCommon(PaymentAcquirerCommon):
def setUp(self):
@@ -28,8 +26,7 @@ class AuthorizeCommon(PaymentAcquirerCommon):
# self.authorize.auto_confirm = 'confirm_so'
-@odoo.tests.common.at_install(True)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class AuthorizeForm(AuthorizeCommon):
def _authorize_generate_hashing(self, values):
@@ -181,7 +178,9 @@ class AuthorizeForm(AuthorizeCommon):
# check state
self.assertEqual(tx.state, 'error', 'Authorize: erroneous validation did not put tx into error state')
- @unittest.skip("Authorize s2s test disabled: We do not want to overload Authorize.net with runbot's requests")
+
+@odoo.tests.tagged('post_install', '-at_install', '-standard', 'external')
+class AuthorizeForm(AuthorizeCommon):
def test_30_authorize_s2s(self):
# be sure not to do stupid thing
authorize = self.authorize
diff --git a/addons/payment_buckaroo/tests/test_buckaroo.py b/addons/payment_buckaroo/tests/test_buckaroo.py
index 0825f67e875..80c99cbc608 100644
--- a/addons/payment_buckaroo/tests/test_buckaroo.py
+++ b/addons/payment_buckaroo/tests/test_buckaroo.py
@@ -10,8 +10,7 @@ from odoo.addons.payment_buckaroo.controllers.main import BuckarooController
from odoo.tools import mute_logger
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(False)
+@odoo.tests.tagged('-post_install', '-at_install')
class BuckarooCommon(PaymentAcquirerCommon):
def setUp(self):
@@ -20,8 +19,7 @@ class BuckarooCommon(PaymentAcquirerCommon):
self.buckaroo = self.env.ref('payment.payment_acquirer_buckaroo')
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(False)
+@odoo.tests.tagged('-post_install', '-at_install')
class BuckarooForm(BuckarooCommon):
def test_10_Buckaroo_form_render(self):
diff --git a/addons/payment_stripe/tests/test_stripe.py b/addons/payment_stripe/tests/test_stripe.py
index ded2b7e9465..3094bd84be6 100644
--- a/addons/payment_stripe/tests/test_stripe.py
+++ b/addons/payment_stripe/tests/test_stripe.py
@@ -1,13 +1,10 @@
# -*- coding: utf-8 -*-
-import unittest
import odoo
from odoo import fields
from odoo.addons.payment.tests.common import PaymentAcquirerCommon
from odoo.tools import mute_logger
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
class StripeCommon(PaymentAcquirerCommon):
def setUp(self):
@@ -15,11 +12,9 @@ class StripeCommon(PaymentAcquirerCommon):
self.stripe = self.env.ref('payment.payment_acquirer_stripe')
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install', '-standard', 'external')
class StripeTest(StripeCommon):
- @unittest.skip("Stripe test disabled: We do not want to overload Stripe with runbot's requests")
def test_10_stripe_s2s(self):
self.assertEqual(self.stripe.environment, 'test', 'test without test environment')
@@ -55,7 +50,6 @@ class StripeTest(StripeCommon):
# Check state
self.assertEqual(tx.state, 'done', 'Stripe: Transcation has been discarded.')
- @unittest.skip("Stripe test disabled: We do not want to overload Stripe with runbot's requests")
def test_20_stripe_form_render(self):
self.assertEqual(self.stripe.environment, 'test', 'test without test environment')
@@ -88,7 +82,6 @@ class StripeTest(StripeCommon):
'Stripe: wrong value for input %s: received %s instead of %s' % (email, email, form_values.get('email'))
)
- @unittest.skip("Stripe test disabled: We do not want to overload Stripe with runbot's requests")
def test_30_stripe_form_management(self):
self.assertEqual(self.stripe.environment, 'test', 'test without test environment')
diff --git a/addons/point_of_sale/tests/test_point_of_sale_flow.py b/addons/point_of_sale/tests/test_point_of_sale_flow.py
index af5b4e93373..0e4f1a0d6ad 100644
--- a/addons/point_of_sale/tests/test_point_of_sale_flow.py
+++ b/addons/point_of_sale/tests/test_point_of_sale_flow.py
@@ -7,8 +7,7 @@ from odoo.tools import float_compare, mute_logger, test_reports
from odoo.addons.point_of_sale.tests.common import TestPointOfSaleCommon
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestPointOfSaleFlow(TestPointOfSaleCommon):
def test_register_open(self):
diff --git a/addons/point_of_sale/tests/test_point_of_sale_ui.py b/addons/point_of_sale/tests/test_point_of_sale_ui.py
index afd9c16e240..2298b41064f 100644
--- a/addons/point_of_sale/tests/test_point_of_sale_ui.py
+++ b/addons/point_of_sale/tests/test_point_of_sale_ui.py
@@ -3,8 +3,7 @@
import odoo.tests
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_point_of_sale_tour(self):
diff --git a/addons/portal/tests/test_load_process.py b/addons/portal/tests/test_load_process.py
index 344d8bec7a9..94904f26afc 100644
--- a/addons/portal/tests/test_load_process.py
+++ b/addons/portal/tests/test_load_process.py
@@ -3,8 +3,7 @@
import odoo.tests
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_portal_load_tour(self):
self.phantom_js(
diff --git a/addons/project/tests/test_project_ui.py b/addons/project/tests/test_project_ui.py
index 7648fdbeb1b..2218e491838 100644
--- a/addons/project/tests/test_project_ui.py
+++ b/addons/project/tests/test_project_ui.py
@@ -3,8 +3,7 @@
import odoo.tests
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_project_tour(self):
diff --git a/addons/purchase/tests/test_purchase_order.py b/addons/purchase/tests/test_purchase_order.py
index edab672a214..94c9db5fba7 100644
--- a/addons/purchase/tests/test_purchase_order.py
+++ b/addons/purchase/tests/test_purchase_order.py
@@ -5,8 +5,10 @@ from datetime import datetime
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestPurchaseOrder(AccountingTestCase):
def setUp(self):
diff --git a/addons/repair/tests/test_repair.py b/addons/repair/tests/test_repair.py
index d3a513916b9..2a2e5f53f77 100644
--- a/addons/repair/tests/test_repair.py
+++ b/addons/repair/tests/test_repair.py
@@ -2,8 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestRepair(AccountingTestCase):
def setUp(self):
diff --git a/addons/sale_expense/tests/test_sale_expense.py b/addons/sale_expense/tests/test_sale_expense.py
index 1fd00aa2a68..05e20929402 100644
--- a/addons/sale_expense/tests/test_sale_expense.py
+++ b/addons/sale_expense/tests/test_sale_expense.py
@@ -2,8 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale.tests.test_sale_common import TestSale
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestSaleExpense(TestSale):
def test_sale_expense(self):
""" Test the behaviour of sales orders when managing expenses """
diff --git a/addons/sale_management/tests/test_sale_ui.py b/addons/sale_management/tests/test_sale_ui.py
index 7db363187dd..96b19061280 100644
--- a/addons/sale_management/tests/test_sale_ui.py
+++ b/addons/sale_management/tests/test_sale_ui.py
@@ -1,8 +1,7 @@
import odoo.tests
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_sale_tour(self):
diff --git a/addons/sale_stock/tests/test_sale_stock.py b/addons/sale_stock/tests/test_sale_stock.py
index 5a6e43377fe..e349a838eeb 100644
--- a/addons/sale_stock/tests/test_sale_stock.py
+++ b/addons/sale_stock/tests/test_sale_stock.py
@@ -3,8 +3,10 @@
from odoo.addons.sale.tests.test_sale_common import TestSale
from odoo.exceptions import UserError
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestSaleStock(TestSale):
def test_00_sale_stock_invoice(self):
"""
diff --git a/addons/sale_timesheet/tests/test_timesheet_revenue.py b/addons/sale_timesheet/tests/test_timesheet_revenue.py
index eb33a366bf8..cbd49c03dd3 100644
--- a/addons/sale_timesheet/tests/test_timesheet_revenue.py
+++ b/addons/sale_timesheet/tests/test_timesheet_revenue.py
@@ -4,8 +4,10 @@
from odoo.addons.sale.tests.test_sale_common import TestSale
from odoo.exceptions import UserError
from odoo.tools import float_repr
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestSaleTimesheet(TestSale):
def setUp(self):
diff --git a/addons/stock_landed_costs/tests/test_stock_landed_costs.py b/addons/stock_landed_costs/tests/test_stock_landed_costs.py
index 1d709b17f16..de2f1ecd309 100644
--- a/addons/stock_landed_costs/tests/test_stock_landed_costs.py
+++ b/addons/stock_landed_costs/tests/test_stock_landed_costs.py
@@ -3,8 +3,10 @@
from odoo.addons.stock_landed_costs.tests.common import TestStockLandedCostsCommon
from odoo.exceptions import ValidationError
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestStockLandedCosts(TestStockLandedCostsCommon):
def test_stock_landed_costs(self):
diff --git a/addons/stock_landed_costs/tests/test_stock_landed_costs_purchase.py b/addons/stock_landed_costs/tests/test_stock_landed_costs_purchase.py
index ccff987ca07..990292b518a 100644
--- a/addons/stock_landed_costs/tests/test_stock_landed_costs_purchase.py
+++ b/addons/stock_landed_costs/tests/test_stock_landed_costs_purchase.py
@@ -2,7 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import unittest
from odoo.addons.stock_landed_costs.tests.common import TestStockLandedCostsCommon
+from odoo.tests import tagged
+
+@tagged('post_install', '-at_install')
class TestLandedCosts(TestStockLandedCostsCommon):
def setUp(self):
diff --git a/addons/stock_landed_costs/tests/test_stock_landed_costs_rounding.py b/addons/stock_landed_costs/tests/test_stock_landed_costs_rounding.py
index d069389439a..e9bfd017874 100644
--- a/addons/stock_landed_costs/tests/test_stock_landed_costs_rounding.py
+++ b/addons/stock_landed_costs/tests/test_stock_landed_costs_rounding.py
@@ -2,8 +2,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.stock_landed_costs.tests.common import TestStockLandedCostsCommon
+from odoo.tests import tagged
+@tagged('post_install', '-at_install')
class TestStockLandedCostsRounding(TestStockLandedCostsCommon):
def test_stock_landed_costs_rounding(self):
diff --git a/addons/survey/tests/test_survey_ui.py b/addons/survey/tests/test_survey_ui.py
index 8c1b4616eb0..f4c65e8fe81 100644
--- a/addons/survey/tests/test_survey_ui.py
+++ b/addons/survey/tests/test_survey_ui.py
@@ -1,12 +1,9 @@
import odoo.tests
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
+@odoo.tests.common.tagged('post_install','-at_install')
class TestUi(odoo.tests.HttpCase):
- post_install = True
- at_install = False
-
def test_01_admin_survey_tour(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('test_survey')", "odoo.__DEBUG__.services['web_tour.tour'].tours.test_survey.ready", login="admin")
diff --git a/addons/web/tests/test_js.py b/addons/web/tests/test_js.py
index 49f5b8d6dce..7e464997225 100644
--- a/addons/web/tests/test_js.py
+++ b/addons/web/tests/test_js.py
@@ -6,10 +6,9 @@ import odoo.tests
RE_ONLY = re.compile('QUnit\.only\(')
-class WebSuite(odoo.tests.HttpCase):
- post_install = True
- at_install = False
+@odoo.tests.tagged('post_install', '-at_install')
+class WebSuite(odoo.tests.HttpCase):
def test_01_js(self):
# webclient desktop test suite
diff --git a/addons/web/tests/test_menu.py b/addons/web/tests/test_menu.py
index 71182f35956..e608196ecd0 100644
--- a/addons/web/tests/test_menu.py
+++ b/addons/web/tests/test_menu.py
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
+from odoo.tests.common import tagged
import unittest
from ..controllers import main
+@tagged('standard', 'at_install')
class ActionMungerTest(unittest.TestCase):
def test_actual_treeview(self):
action = {
diff --git a/addons/web/tests/test_serving_base.py b/addons/web/tests/test_serving_base.py
index 3974e798461..614f8a826ed 100644
--- a/addons/web/tests/test_serving_base.py
+++ b/addons/web/tests/test_serving_base.py
@@ -4,6 +4,7 @@
import random
import unittest
+from odoo.tests.common import tagged
from odoo.tools import topological_sort
@@ -13,6 +14,7 @@ def sample(population):
random.randint(0, min(len(population), 5)))
+@tagged('stantard', 'at_install')
class TestModulesLoading(unittest.TestCase):
def setUp(self):
self.mods = [str(i) for i in range(1000)]
diff --git a/addons/web_editor/tests/test_converter.py b/addons/web_editor/tests/test_converter.py
index 761de27515f..bb778b07799 100644
--- a/addons/web_editor/tests/test_converter.py
+++ b/addons/web_editor/tests/test_converter.py
@@ -11,6 +11,7 @@ from odoo.tests import common
from odoo.addons.web_editor.models.ir_qweb import html_to_text
+@common.tagged('standard', 'at_install')
class TestHTMLToText(unittest.TestCase):
def test_rawstring(self):
self.assertEqual(
diff --git a/addons/web_editor/tests/test_ui.py b/addons/web_editor/tests/test_ui.py
index 3a05da5acc9..9e9527e2d14 100644
--- a/addons/web_editor/tests/test_ui.py
+++ b/addons/web_editor/tests/test_ui.py
@@ -3,13 +3,9 @@
import odoo.tests
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
- post_install = True
- at_install = False
-
def test_01_admin_rte(self):
self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('rte')", "odoo.__DEBUG__.services['web_tour.tour'].tours.rte.ready", login='admin')
diff --git a/addons/website/tests/test_converter.py b/addons/website/tests/test_converter.py
index ce74f1009d4..0412ae49ce0 100644
--- a/addons/website/tests/test_converter.py
+++ b/addons/website/tests/test_converter.py
@@ -3,8 +3,10 @@
import unittest
from odoo.addons.http_routing.models.ir_http import slugify, unslug
+from odoo.tests.common import tagged
+@tagged('stantard', 'at_install')
class TestUnslug(unittest.TestCase):
def test_unslug(self):
@@ -27,6 +29,7 @@ class TestUnslug(unittest.TestCase):
self.assertEqual(unslug(slug), expected)
+@tagged('standard', 'at_install')
class TestTitleToSlug(unittest.TestCase):
"""
Those tests should pass with or without python-slugify
diff --git a/addons/website/tests/test_crawl.py b/addons/website/tests/test_crawl.py
index f5d4bc4ec12..2c138658740 100644
--- a/addons/website/tests/test_crawl.py
+++ b/addons/website/tests/test_crawl.py
@@ -15,6 +15,7 @@ from odoo.tools import pycompat
_logger = logging.getLogger(__name__)
+@odoo.tests.common.tagged('post_install', '-at_install')
class Crawler(odoo.tests.HttpCase):
""" Test suite crawling an Odoo CMS instance and checking that all
internal links lead to a 200 response.
@@ -23,9 +24,6 @@ class Crawler(odoo.tests.HttpCase):
starting the crawl
"""
- at_install = False
- post_install = True
-
def crawl(self, url, seen=None, msg=''):
if seen is None:
seen = set()
diff --git a/addons/website/tests/test_ui.py b/addons/website/tests/test_ui.py
index 51949190351..0cf61f88c30 100644
--- a/addons/website/tests/test_ui.py
+++ b/addons/website/tests/test_ui.py
@@ -8,9 +8,9 @@ class TestUiTranslate(odoo.tests.HttpCase):
def test_admin_tour_rte_translator(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('rte_translator')", "odoo.__DEBUG__.services['web_tour.tour'].tours.rte_translator.ready", login='admin', timeout=120)
+
+@odoo.tests.common.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
- post_install = True
- at_install = False
def test_01_public_homepage(self):
self.phantom_js("/", "console.log('ok')", "'website.content.snippets.animation' in odoo.__DEBUG__.services")
diff --git a/addons/website_blog/tests/test_ui.py b/addons/website_blog/tests/test_ui.py
index 152b4b980c1..1de418350cc 100644
--- a/addons/website_blog/tests/test_ui.py
+++ b/addons/website_blog/tests/test_ui.py
@@ -3,8 +3,7 @@
import odoo.tests
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_admin(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('blog')", "odoo.__DEBUG__.services['web_tour.tour'].tours.blog.ready", login='admin')
diff --git a/addons/website_crm/tests/test_website_crm.py b/addons/website_crm/tests/test_website_crm.py
index 0ac1bfa6ecf..cc2db89fdc1 100644
--- a/addons/website_crm/tests/test_website_crm.py
+++ b/addons/website_crm/tests/test_website_crm.py
@@ -5,8 +5,7 @@ from odoo.api import Environment
import odoo.tests
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestWebsiteCrm(odoo.tests.HttpCase):
def test_tour(self):
diff --git a/addons/website_event/tests/test_ui.py b/addons/website_event/tests/test_ui.py
index ad78445d184..06da539287b 100644
--- a/addons/website_event/tests/test_ui.py
+++ b/addons/website_event/tests/test_ui.py
@@ -1,8 +1,7 @@
import odoo.tests
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_admin(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('event')", "odoo.__DEBUG__.services['web_tour.tour'].tours.event.ready", login='admin')
diff --git a/addons/website_event_sale/tests/test_ui.py b/addons/website_event_sale/tests/test_ui.py
index c2e6f04f4a6..b1f5b5ce2c3 100644
--- a/addons/website_event_sale/tests/test_ui.py
+++ b/addons/website_event_sale/tests/test_ui.py
@@ -1,11 +1,9 @@
import odoo.tests
+@odoo.tests.common.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
- post_install = True
- at_install = False
-
def test_admin(self):
# Seen that:
# - this test relies on demo data that are entirely in USD (pricelists)
diff --git a/addons/website_forum/tests/test_forum_process.py b/addons/website_forum/tests/test_forum_process.py
index 2f23ebae67e..52f49be3133 100644
--- a/addons/website_forum/tests/test_forum_process.py
+++ b/addons/website_forum/tests/test_forum_process.py
@@ -2,11 +2,9 @@
import odoo.tests
+@odoo.tests.common.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
- post_install = True
- at_install = False
-
def test_01_admin_forum_tour(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('question')", "odoo.__DEBUG__.services['web_tour.tour'].tours.question.ready", login="admin")
diff --git a/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py b/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py
index db68b4811d6..169795e5f1c 100644
--- a/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py
+++ b/addons/website_hr_recruitment/tests/test_website_hr_recruitment.py
@@ -4,8 +4,7 @@
from odoo.api import Environment
import odoo.tests
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestWebsiteHrRecruitmentForm(odoo.tests.HttpCase):
def test_tour(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('website_hr_recruitment_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.website_hr_recruitment_tour.ready")
diff --git a/addons/website_sale/tests/test_sale_process.py b/addons/website_sale/tests/test_sale_process.py
index fab3e63b559..ae3f63e436f 100644
--- a/addons/website_sale/tests/test_sale_process.py
+++ b/addons/website_sale/tests/test_sale_process.py
@@ -3,8 +3,7 @@
import odoo.tests
-@odoo.tests.common.at_install(False)
-@odoo.tests.common.post_install(True)
+@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_admin_shop_tour(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop.ready", login="admin")
diff --git a/addons/website_sale_options/tests/test_customize.py b/addons/website_sale_options/tests/test_customize.py
index d081583e818..e387c068a0b 100644
--- a/addons/website_sale_options/tests/test_customize.py
+++ b/addons/website_sale_options/tests/test_customize.py
@@ -2,10 +2,8 @@
import odoo.tests
+@odoo.tests.common.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
- post_install = True
- at_install = False
-
def test_01_admin_shop_customize_tour(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web_tour.tour'].run('shop_customize')", "odoo.__DEBUG__.services['web_tour.tour'].tours.shop_customize.ready", login="admin")