Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Move plugin tests
fowczrekae77c912557c
diff --git a/conftest.py b/conftest.pyindex 75305858c3..262b94e4bf 100644--- a/conftest.py+++ b/conftest.py@@ -1 +1 @@-pytest_plugins = "tests.fixtures"+pytest_plugins = ["tests.fixtures", "saleor.plugins.tests.fixtures"]diff --git a/saleor/plugins/avatax/tests/__init__.py b/saleor/plugins/avatax/tests/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/tests/plugins/cassettes/test_calculate_checkout_line_total[False-24.39-30.00-True].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_line_total[False-24.39-30.00-True].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_line_total[False-24.39-30.00-True].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_line_total[False-24.39-30.00-True].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_line_total[False-30.00-36.90-False].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_line_total[False-30.00-36.90-False].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_line_total[False-30.00-36.90-False].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_line_total[False-30.00-36.90-False].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_line_total[True-12.20-15.00-True].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_line_total[True-12.20-15.00-True].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_line_total[True-12.20-15.00-True].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_line_total[True-12.20-15.00-True].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_line_total[True-15.00-18.45-False].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_line_total[True-15.00-18.45-False].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_line_total[True-15.00-18.45-False].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_line_total[True-15.00-18.45-False].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_shipping.yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_shipping.yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_shipping.yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_shipping.yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_subtotal[False-40.65-50.00-True].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_subtotal[False-40.65-50.00-True].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_subtotal[False-40.65-50.00-True].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_subtotal[False-40.65-50.00-True].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_subtotal[False-50.00-61.50-False].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_subtotal[False-50.00-61.50-False].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_subtotal[False-50.00-61.50-False].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_subtotal[False-50.00-61.50-False].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_subtotal[True-20.33-25.00-True].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_subtotal[True-20.33-25.00-True].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_subtotal[True-20.33-25.00-True].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_subtotal[True-20.33-25.00-True].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_subtotal[True-25.00-30.75-False].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_subtotal[True-25.00-30.75-False].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_subtotal[True-25.00-30.75-False].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_subtotal[True-25.00-30.75-False].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_total[False-29.52-37.00-3.0-True].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[False-29.52-37.00-3.0-True].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_total[False-29.52-37.00-3.0-True].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[False-29.52-37.00-3.0-True].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_total[False-37.00-37.00-3.0-True].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[False-37.00-37.00-3.0-True].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_total[False-37.00-37.00-3.0-True].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[False-37.00-37.00-3.0-True].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_total[False-40.00-40.00-0.0-False].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[False-40.00-40.00-0.0-False].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_total[False-40.00-40.00-0.0-False].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[False-40.00-40.00-0.0-False].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_total[False-40.00-49.20-0.0-False].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[False-40.00-49.20-0.0-False].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_total[False-40.00-49.20-0.0-False].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[False-40.00-49.20-0.0-False].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_total[True-20.00-20.00-5.0-False].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[True-20.00-20.00-5.0-False].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_total[True-20.00-20.00-5.0-False].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[True-20.00-20.00-5.0-False].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_total[True-20.00-25.75-5.0-False].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[True-20.00-25.75-5.0-False].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_total[True-20.00-25.75-5.0-False].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[True-20.00-25.75-5.0-False].yamldiff --git a/tests/plugins/cassettes/test_calculate_checkout_total[True-20.33-25.00-0.0-True].yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[True-20.33-25.00-0.0-True].yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_checkout_total[True-20.33-25.00-0.0-True].yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_checkout_total[True-20.33-25.00-0.0-True].yamldiff --git a/tests/plugins/cassettes/test_calculate_order_line_unit.yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_order_line_unit.yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_order_line_unit.yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_order_line_unit.yamldiff --git a/tests/plugins/cassettes/test_calculate_order_shipping.yaml b/saleor/plugins/avatax/tests/cassettes/test_calculate_order_shipping.yamlsimilarity index 100%rename from tests/plugins/cassettes/test_calculate_order_shipping.yamlrename to saleor/plugins/avatax/tests/cassettes/test_calculate_order_shipping.yamldiff --git a/tests/plugins/cassettes/test_get_cached_tax_codes_or_fetch.yaml b/saleor/plugins/avatax/tests/cassettes/test_get_cached_tax_codes_or_fetch.yamlsimilarity index 100%rename from tests/plugins/cassettes/test_get_cached_tax_codes_or_fetch.yamlrename to saleor/plugins/avatax/tests/cassettes/test_get_cached_tax_codes_or_fetch.yamldiff --git a/tests/plugins/cassettes/test_get_cached_tax_codes_or_fetch_wrong_response.yaml b/saleor/plugins/avatax/tests/cassettes/test_get_cached_tax_codes_or_fetch_wrong_response.yamlsimilarity index 100%rename from tests/plugins/cassettes/test_get_cached_tax_codes_or_fetch_wrong_response.yamlrename to saleor/plugins/avatax/tests/cassettes/test_get_cached_tax_codes_or_fetch_wrong_response.yamldiff --git a/tests/plugins/cassettes/test_plugin_uses_configuration_from_db.yaml b/saleor/plugins/avatax/tests/cassettes/test_plugin_uses_configuration_from_db.yamlsimilarity index 100%rename from tests/plugins/cassettes/test_plugin_uses_configuration_from_db.yamlrename to saleor/plugins/avatax/tests/cassettes/test_plugin_uses_configuration_from_db.yamldiff --git a/tests/plugins/cassettes/test_preprocess_order_creation.yaml b/saleor/plugins/avatax/tests/cassettes/test_preprocess_order_creation.yamlsimilarity index 100%rename from tests/plugins/cassettes/test_preprocess_order_creation.yamlrename to saleor/plugins/avatax/tests/cassettes/test_preprocess_order_creation.yamldiff --git a/tests/plugins/cassettes/test_preprocess_order_creation_wrong_data.yaml b/saleor/plugins/avatax/tests/cassettes/test_preprocess_order_creation_wrong_data.yamlsimilarity index 100%rename from tests/plugins/cassettes/test_preprocess_order_creation_wrong_data.yamlrename to saleor/plugins/avatax/tests/cassettes/test_preprocess_order_creation_wrong_data.yamldiff --git a/tests/plugins/test_avatax.py b/saleor/plugins/avatax/tests/test_avatax.pysimilarity index 100%rename from tests/plugins/test_avatax.pyrename to saleor/plugins/avatax/tests/test_avatax.pydiff --git a/saleor/plugins/tests/__init__.py b/saleor/plugins/tests/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/tests/plugins/conftest.py b/saleor/plugins/tests/fixtures.pysimilarity index 97%rename from tests/plugins/conftest.pyrename to saleor/plugins/tests/fixtures.pyindex b1457bcda2..1ac98ce406 100644--- a/tests/plugins/conftest.py+++ b/saleor/plugins/tests/fixtures.py@@ -4,7 +4,7 @@ from django_prices_vatlayer.utils import get_tax_for_ratefrom saleor.plugins.base_plugin import ConfigurationTypeFieldfrom saleor.plugins.models import PluginConfiguration-from tests.plugins.sample_plugins import PluginInactive, PluginSample+from saleor.plugins.tests.sample_plugins import PluginInactive, PluginSample@pytest.fixturediff --git a/tests/plugins/sample_plugins.py b/saleor/plugins/tests/sample_plugins.pysimilarity index 100%rename from tests/plugins/sample_plugins.pyrename to saleor/plugins/tests/sample_plugins.pydiff --git a/tests/plugins/test_checks.py b/saleor/plugins/tests/test_checks.pysimilarity index 100%rename from tests/plugins/test_checks.pyrename to saleor/plugins/tests/test_checks.pydiff --git a/tests/plugins/test_manager.py b/saleor/plugins/tests/test_manager.pysimilarity index 81%rename from tests/plugins/test_manager.pyrename to saleor/plugins/tests/test_manager.pyindex f4dfde9f4b..865eb3fc94 100644--- a/tests/plugins/test_manager.py+++ b/saleor/plugins/tests/test_manager.py@@ -7,7 +7,7 @@ from prices import Money, TaxedMoneyfrom saleor.core.taxes import TaxTypefrom saleor.plugins.manager import PluginsManager, get_plugins_managerfrom saleor.plugins.models import PluginConfiguration-from tests.plugins.sample_plugins import (+from saleor.plugins.tests.sample_plugins import (ActivePaymentGateway,InactivePaymentGateway,PluginInactive,@@ -17,7 +17,7 @@ from tests.plugins.sample_plugins import (def test_get_plugins_manager():manager_path = "saleor.plugins.manager.PluginsManager"- plugin_path = "tests.plugins.sample_plugins.PluginSample"+ plugin_path = "saleor.plugins.tests.sample_plugins.PluginSample"manager = get_plugins_manager(manager_path=manager_path, plugins=[plugin_path])assert isinstance(manager, PluginsManager)assert len(manager.plugins) == 1@@ -25,7 +25,7 @@ def test_get_plugins_manager():@pytest.mark.parametrize("plugins, total_amount",- [(["tests.plugins.sample_plugins.PluginSample"], "1.0"), ([], "15.0")],+ [(["saleor.plugins.tests.sample_plugins.PluginSample"], "1.0"), ([], "15.0")],)def test_manager_calculates_checkout_total(checkout_with_item, discount_info, plugins, total_amount@@ -41,7 +41,7 @@ def test_manager_calculates_checkout_total(@pytest.mark.parametrize("plugins, subtotal_amount",- [(["tests.plugins.sample_plugins.PluginSample"], "1.0"), ([], "15.0")],+ [(["saleor.plugins.tests.sample_plugins.PluginSample"], "1.0"), ([], "15.0")],)def test_manager_calculates_checkout_subtotal(checkout_with_item, discount_info, plugins, subtotal_amount@@ -56,7 +56,7 @@ def test_manager_calculates_checkout_subtotal(@pytest.mark.parametrize("plugins, shipping_amount",- [(["tests.plugins.sample_plugins.PluginSample"], "1.0"), ([], "0.0")],+ [(["saleor.plugins.tests.sample_plugins.PluginSample"], "1.0"), ([], "0.0")],)def test_manager_calculates_checkout_shipping(checkout_with_item, discount_info, plugins, shipping_amount@@ -74,7 +74,7 @@ def test_manager_calculates_checkout_shipping(@pytest.mark.parametrize("plugins, shipping_amount",- [(["tests.plugins.sample_plugins.PluginSample"], "1.0"), ([], "10.0")],+ [(["saleor.plugins.tests.sample_plugins.PluginSample"], "1.0"), ([], "10.0")],)def test_manager_calculates_order_shipping(order_with_lines, plugins, shipping_amount):currency = order_with_lines.total.currency@@ -91,7 +91,7 @@ def test_manager_calculates_order_shipping(order_with_lines, plugins, shipping_a@pytest.mark.parametrize("plugins, amount",- [(["tests.plugins.sample_plugins.PluginSample"], "1.0"), ([], "15.0")],+ [(["saleor.plugins.tests.sample_plugins.PluginSample"], "1.0"), ([], "15.0")],)def test_manager_calculates_checkout_line_total(checkout_with_item, discount_info, plugins, amount@@ -107,7 +107,7 @@ def test_manager_calculates_checkout_line_total(@pytest.mark.parametrize("plugins, amount",- [(["tests.plugins.sample_plugins.PluginSample"], "1.0"), ([], "12.30")],+ [(["saleor.plugins.tests.sample_plugins.PluginSample"], "1.0"), ([], "12.30")],)def test_manager_calculates_order_line(order_line, plugins, amount):currency = order_line.unit_price.currency@@ -120,7 +120,7 @@ def test_manager_calculates_order_line(order_line, plugins, amount):"plugins, tax_rate_list",[(- ["tests.plugins.sample_plugins.PluginSample"],+ ["saleor.plugins.tests.sample_plugins.PluginSample"],[TaxType(code="123", description="abc")],),([], []),@@ -132,7 +132,7 @@ def test_manager_uses_get_tax_rate_choices(plugins, tax_rate_list):@pytest.mark.parametrize("plugins, show_taxes",- [(["tests.plugins.sample_plugins.PluginSample"], True), ([], False)],+ [(["saleor.plugins.tests.sample_plugins.PluginSample"], True), ([], False)],)def test_manager_show_taxes_on_storefront(plugins, show_taxes):assert show_taxes == PluginsManager(plugins=plugins).show_taxes_on_storefront()@@ -140,7 +140,7 @@ def test_manager_show_taxes_on_storefront(plugins, show_taxes):@pytest.mark.parametrize("plugins, price",- [(["tests.plugins.sample_plugins.PluginSample"], "1.0"), ([], "10.0")],+ [(["saleor.plugins.tests.sample_plugins.PluginSample"], "1.0"), ([], "10.0")],)def test_manager_apply_taxes_to_product(product, plugins, price):country = Country("PL")@@ -155,7 +155,7 @@ def test_manager_apply_taxes_to_product(product, plugins, price):@pytest.mark.parametrize("plugins, price_amount",- [(["tests.plugins.sample_plugins.PluginSample"], "1.0"), ([], "10.0")],+ [(["saleor.plugins.tests.sample_plugins.PluginSample"], "1.0"), ([], "10.0")],)def test_manager_apply_taxes_to_shipping(shipping_method, address, plugins, price_amount@@ -169,7 +169,7 @@ def test_manager_apply_taxes_to_shipping(@pytest.mark.parametrize("plugins, amount",- [(["tests.plugins.sample_plugins.PluginSample"], "15.0"), ([], "0")],+ [(["saleor.plugins.tests.sample_plugins.PluginSample"], "15.0"), ([], "0")],)def test_manager_get_tax_rate_percentage_value(plugins, amount, product):country = Country("PL")@@ -181,8 +181,8 @@ def test_manager_get_tax_rate_percentage_value(plugins, amount, product):def test_manager_get_plugin_configurations(plugin_configuration):plugins = [- "tests.plugins.sample_plugins.PluginSample",- "tests.plugins.sample_plugins.PluginInactive",+ "saleor.plugins.tests.sample_plugins.PluginSample",+ "saleor.plugins.tests.sample_plugins.PluginInactive",]manager = PluginsManager(plugins=plugins)plugin_configs = manager._plugin_configs.values()@@ -192,8 +192,8 @@ def test_manager_get_plugin_configurations(plugin_configuration):def test_manager_get_plugin_configuration(plugin_configuration):plugins = [- "tests.plugins.sample_plugins.PluginSample",- "tests.plugins.sample_plugins.PluginInactive",+ "saleor.plugins.tests.sample_plugins.PluginSample",+ "saleor.plugins.tests.sample_plugins.PluginInactive",]manager = PluginsManager(plugins=plugins)plugin = manager.get_plugin(PluginSample.PLUGIN_ID)@@ -204,7 +204,7 @@ def test_manager_get_plugin_configuration(plugin_configuration):def test_manager_save_plugin_configuration(plugin_configuration):- plugins = ["tests.plugins.sample_plugins.PluginSample"]+ plugins = ["saleor.plugins.tests.sample_plugins.PluginSample"]manager = PluginsManager(plugins=plugins)manager.save_plugin_configuration(PluginSample.PLUGIN_ID, {"active": False})plugin_configuration.refresh_from_db()@@ -225,7 +225,9 @@ def test_plugin_updates_configuration_shape(plugin_configuration.configuration + [new_config],)- manager = PluginsManager(plugins=["tests.plugins.sample_plugins.PluginSample"])+ manager = PluginsManager(+ plugins=["saleor.plugins.tests.sample_plugins.PluginSample"]+ )plugin = manager.get_plugin(PluginSample.PLUGIN_ID)assert len(plugin.configuration) == 5@@ -241,7 +243,9 @@ def test_plugin_add_new_configuration()config_structure = {"Foo": new_config_structure}monkeypatch.setattr(PluginInactive, "CONFIG_STRUCTURE", config_structure)- manager = PluginsManager(plugins=["tests.plugins.sample_plugins.PluginInactive"])+ manager = PluginsManager(+ plugins=["saleor.plugins.tests.sample_plugins.PluginInactive"]+ )plugin = manager.get_plugin(PluginInactive.PLUGIN_ID)assert len(plugin.configuration) == 1assert plugin.configuration[0] == {**new_config, **new_config_structure}@@ -254,9 +258,9 @@ def test_manager_serve_list_of_payment_gateways():"config": ActivePaymentGateway.CLIENT_CONFIG,}plugins = [- "tests.plugins.sample_plugins.PluginSample",- "tests.plugins.sample_plugins.ActivePaymentGateway",- "tests.plugins.sample_plugins.InactivePaymentGateway",+ "saleor.plugins.tests.sample_plugins.PluginSample",+ "saleor.plugins.tests.sample_plugins.ActivePaymentGateway",+ "saleor.plugins.tests.sample_plugins.InactivePaymentGateway",]manager = PluginsManager(plugins=plugins)assert manager.list_payment_gateways() == [expected_gateway]@@ -277,8 +281,8 @@ def test_manager_serve_list_all_payment_gateways():]plugins = [- "tests.plugins.sample_plugins.ActivePaymentGateway",- "tests.plugins.sample_plugins.InactivePaymentGateway",+ "saleor.plugins.tests.sample_plugins.ActivePaymentGateway",+ "saleor.plugins.tests.sample_plugins.InactivePaymentGateway",]manager = PluginsManager(plugins=plugins)assert manager.list_payment_gateways(active_only=False) == expected_gatewaysdiff --git a/tests/plugins/test_plugins.py b/saleor/plugins/tests/test_plugins.pysimilarity index 96%rename from tests/plugins/test_plugins.pyrename to saleor/plugins/tests/test_plugins.pyindex e250bbc0db..35f8c6ca35 100644--- a/tests/plugins/test_plugins.py+++ b/saleor/plugins/tests/test_plugins.py@@ -1,12 +1,12 @@from saleor.plugins.anonymize.plugin import AnonymizePluginfrom saleor.plugins.base_plugin import ConfigurationTypeFieldfrom saleor.plugins.manager import get_plugins_manager-from tests.plugins.sample_plugins import PluginSample-from tests.plugins.utils import get_config_value+from saleor.plugins.tests.sample_plugins import PluginSample+from saleor.plugins.tests.utils import get_config_valuedef test_update_config_items_keeps_bool_value(plugin_configuration, settings):- settings.PLUGINS = ["tests.plugins.sample_plugins.PluginSample"]+ settings.PLUGINS = ["saleor.plugins.tests.sample_plugins.PluginSample"]data_to_update = [{"name": "Username", "value": "[email protected]"},{"name": "Use sandbox", "value": False},@@ -163,7 +163,7 @@ def test_base_plugin__update_configuration_structure_configuration_has_change(def test_base_plugin__append_config_structure_to_config(settings):- settings.PLUGINS = ["tests.plugins.sample_plugins.PluginSample"]+ settings.PLUGINS = ["saleor.plugins.tests.sample_plugins.PluginSample"]manager = get_plugins_manager()plugin = manager.get_plugin(PluginSample.PLUGIN_ID)config = [diff --git a/tests/plugins/utils.py b/saleor/plugins/tests/utils.pysimilarity index 100%rename from tests/plugins/utils.pyrename to saleor/plugins/tests/utils.pydiff --git a/saleor/plugins/vatlayer/tests/__init__.py b/saleor/plugins/vatlayer/tests/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/tests/plugins/test_vatlayer.py b/saleor/plugins/vatlayer/tests/test_vatlayer.pysimilarity index 99%rename from tests/plugins/test_vatlayer.pyrename to saleor/plugins/vatlayer/tests/test_vatlayer.pyindex 94c879fb56..cc06dd383b 100644--- a/tests/plugins/test_vatlayer.py+++ b/saleor/plugins/vatlayer/tests/test_vatlayer.py@@ -246,7 +246,6 @@ def test_calculate_checkout_total()@pytest.mark.parametrize("with_discount, expected_net, expected_gross, taxes_in_prices",[diff --git a/saleor/plugins/webhook/tests/__init__.py b/saleor/plugins/webhook/tests/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/tests/plugins/cassettes/test_trigger_webhooks_for_event.yaml b/saleor/plugins/webhook/tests/cassettes/test_trigger_webhooks_for_event.yamlsimilarity index 100%rename from tests/plugins/cassettes/test_trigger_webhooks_for_event.yamlrename to saleor/plugins/webhook/tests/cassettes/test_trigger_webhooks_for_event.yamldiff --git a/tests/plugins/cassettes/test_trigger_webhooks_for_event_with_secret_key.yaml b/saleor/plugins/webhook/tests/cassettes/test_trigger_webhooks_for_event_with_secret_key.yamlsimilarity index 100%rename from tests/plugins/cassettes/test_trigger_webhooks_for_event_with_secret_key.yamlrename to saleor/plugins/webhook/tests/cassettes/test_trigger_webhooks_for_event_with_secret_key.yamldiff --git a/tests/plugins/test_webhook.py b/saleor/plugins/webhook/tests/test_webhook.pysimilarity index 100%rename from tests/plugins/test_webhook.pyrename to saleor/plugins/webhook/tests/test_webhook.pydiff --git a/tests/api/test_plugins.py b/tests/api/test_plugins.pyindex 5be29d9c23..8570456d8d 100644--- a/tests/api/test_plugins.py+++ b/tests/api/test_plugins.py@@ -6,9 +6,9 @@ from saleor.plugins.base_plugin import ConfigurationTypeFieldfrom saleor.plugins.error_codes import PluginErrorCodefrom saleor.plugins.manager import get_plugins_managerfrom saleor.plugins.models import PluginConfiguration+from saleor.plugins.tests.sample_plugins import PluginSample+from saleor.plugins.tests.utils import get_config_valuefrom tests.api.utils import assert_no_permission, get_graphql_content-from tests.plugins.sample_plugins import PluginSample-from tests.plugins.utils import get_config_value@pytest.fixture@@ -43,7 +43,7 @@ PLUGINS_QUERY = """def test_query_plugin_configurations(staff_api_client_can_manage_plugins, settings):# Enable test plugin- settings.PLUGINS = ["tests.plugins.sample_plugins.PluginSample"]+ settings.PLUGINS = ["saleor.plugins.tests.sample_plugins.PluginSample"]response = staff_api_client_can_manage_plugins.post_graphql(PLUGINS_QUERY)content = get_graphql_content(response)@@ -98,7 +98,7 @@ def test_query_plugins_hides_secret_fields(settings,):- settings.PLUGINS = ["tests.plugins.sample_plugins.PluginSample"]+ settings.PLUGINS = ["saleor.plugins.tests.sample_plugins.PluginSample"]manager = get_plugins_manager()plugin = manager.get_plugin(PluginSample.PLUGIN_ID)configuration = copy.deepcopy(plugin.configuration)@@ -132,7 +132,7 @@ def test_query_plugins_hides_secret_fields(def test_query_plugin_configurations_as_customer_user(user_api_client, settings):- settings.PLUGINS = ["tests.plugins.sample_plugins.PluginSample"]+ settings.PLUGINS = ["saleor.plugins.tests.sample_plugins.PluginSample"]response = user_api_client.post_graphql(PLUGINS_QUERY)assert_no_permission(response)@@ -295,7 +295,7 @@ def test_plugin_configuration_update(staff_api_client_can_manage_plugins, settings, active, updated_configuration_item):- settings.PLUGINS = ["tests.plugins.sample_plugins.PluginSample"]+ settings.PLUGINS = ["saleor.plugins.tests.sample_plugins.PluginSample"]manager = get_plugins_manager()plugin = manager.get_plugin(PluginSample.PLUGIN_ID)old_configuration = copy.deepcopy(plugin.configuration)@@ -343,7 +343,7 @@ def test_plugin_configuration_update_containing_invalid_plugin_id(def test_plugin_update_saves_boolean_as_boolean(staff_api_client_can_manage_plugins, settings):- settings.PLUGINS = ["tests.plugins.sample_plugins.PluginSample"]+ settings.PLUGINS = ["saleor.plugins.tests.sample_plugins.PluginSample"]manager = get_plugins_manager()plugin = manager.get_plugin(PluginSample.PLUGIN_ID)use_sandbox = get_config_value("Use sandbox", plugin.configuration)@@ -375,9 +375,9 @@ def test_plugins_query_with_filter(plugin_filter, count, staff_api_client_can_manage_plugins, settings):settings.PLUGINS = [- "tests.plugins.sample_plugins.PluginSample",- "tests.plugins.sample_plugins.PluginInactive",- "tests.plugins.sample_plugins.ActivePlugin",+ "saleor.plugins.tests.sample_plugins.PluginSample",+ "saleor.plugins.tests.sample_plugins.PluginInactive",+ "saleor.plugins.tests.sample_plugins.ActivePlugin",]query = """query ($filter: PluginFilterInput) {@@ -398,7 +398,7 @@ def test_plugins_query_with_filter(def test_plugin_configuration_update_as_customer_user(user_api_client, settings):- settings.PLUGINS = ["tests.plugins.sample_plugins.PluginSample"]+ settings.PLUGINS = ["saleor.plugins.tests.sample_plugins.PluginSample"]manager = get_plugins_manager()plugin = manager.get_plugin(PluginSample.PLUGIN_ID)@@ -450,9 +450,9 @@ def test_query_plugins_with_sort(plugin_sort, result_order, staff_api_client_can_manage_plugins, settings):settings.PLUGINS = [- "tests.plugins.sample_plugins.PluginSample",- "tests.plugins.sample_plugins.PluginInactive",- "tests.plugins.sample_plugins.ActivePlugin",+ "saleor.plugins.tests.sample_plugins.PluginSample",+ "saleor.plugins.tests.sample_plugins.PluginInactive",+ "saleor.plugins.tests.sample_plugins.ActivePlugin",]variables = {"sort_by": plugin_sort}response = staff_api_client_can_manage_plugins.post_graphql(