Skip to content

Saleor Core: the high performance, composable, headless commerce API.

cleanup tests directory

Damian Wysocki8acb7b239a0f
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_line_total[False-24.39-30.00-True].yaml b/tests/plugins/cassettes/test_calculate_checkout_line_total[False-24.39-30.00-True].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_line_total[False-24.39-30.00-True].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_line_total[False-24.39-30.00-True].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_line_total[False-30.00-36.90-False].yaml b/tests/plugins/cassettes/test_calculate_checkout_line_total[False-30.00-36.90-False].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_line_total[False-30.00-36.90-False].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_line_total[False-30.00-36.90-False].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_line_total[True-12.20-15.00-True].yaml b/tests/plugins/cassettes/test_calculate_checkout_line_total[True-12.20-15.00-True].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_line_total[True-12.20-15.00-True].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_line_total[True-12.20-15.00-True].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_line_total[True-15.00-18.45-False].yaml b/tests/plugins/cassettes/test_calculate_checkout_line_total[True-15.00-18.45-False].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_line_total[True-15.00-18.45-False].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_line_total[True-15.00-18.45-False].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_shipping.yaml b/tests/plugins/cassettes/test_calculate_checkout_shipping.yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_shipping.yaml
rename to tests/plugins/cassettes/test_calculate_checkout_shipping.yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_subtotal[False-40.65-50.00-True].yaml b/tests/plugins/cassettes/test_calculate_checkout_subtotal[False-40.65-50.00-True].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_subtotal[False-40.65-50.00-True].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_subtotal[False-40.65-50.00-True].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_subtotal[False-50.00-61.50-False].yaml b/tests/plugins/cassettes/test_calculate_checkout_subtotal[False-50.00-61.50-False].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_subtotal[False-50.00-61.50-False].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_subtotal[False-50.00-61.50-False].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_subtotal[True-20.33-25.00-True].yaml b/tests/plugins/cassettes/test_calculate_checkout_subtotal[True-20.33-25.00-True].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_subtotal[True-20.33-25.00-True].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_subtotal[True-20.33-25.00-True].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_subtotal[True-25.00-30.75-False].yaml b/tests/plugins/cassettes/test_calculate_checkout_subtotal[True-25.00-30.75-False].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_subtotal[True-25.00-30.75-False].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_subtotal[True-25.00-30.75-False].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_total[False-29.52-37.00-3.0-True].yaml b/tests/plugins/cassettes/test_calculate_checkout_total[False-29.52-37.00-3.0-True].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_total[False-29.52-37.00-3.0-True].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_total[False-29.52-37.00-3.0-True].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_total[False-37.00-37.00-3.0-True].yaml b/tests/plugins/cassettes/test_calculate_checkout_total[False-37.00-37.00-3.0-True].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_total[False-37.00-37.00-3.0-True].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_total[False-37.00-37.00-3.0-True].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_total[False-40.00-40.00-0.0-False].yaml b/tests/plugins/cassettes/test_calculate_checkout_total[False-40.00-40.00-0.0-False].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_total[False-40.00-40.00-0.0-False].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_total[False-40.00-40.00-0.0-False].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_total[False-40.00-49.20-0.0-False].yaml b/tests/plugins/cassettes/test_calculate_checkout_total[False-40.00-49.20-0.0-False].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_total[False-40.00-49.20-0.0-False].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_total[False-40.00-49.20-0.0-False].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_total[True-20.00-20.00-5.0-False].yaml b/tests/plugins/cassettes/test_calculate_checkout_total[True-20.00-20.00-5.0-False].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_total[True-20.00-20.00-5.0-False].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_total[True-20.00-20.00-5.0-False].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_total[True-20.00-25.75-5.0-False].yaml b/tests/plugins/cassettes/test_calculate_checkout_total[True-20.00-25.75-5.0-False].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_total[True-20.00-25.75-5.0-False].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_total[True-20.00-25.75-5.0-False].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_checkout_total[True-20.33-25.00-0.0-True].yaml b/tests/plugins/cassettes/test_calculate_checkout_total[True-20.33-25.00-0.0-True].yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_checkout_total[True-20.33-25.00-0.0-True].yaml
rename to tests/plugins/cassettes/test_calculate_checkout_total[True-20.33-25.00-0.0-True].yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_order_line_unit.yaml b/tests/plugins/cassettes/test_calculate_order_line_unit.yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_order_line_unit.yaml
rename to tests/plugins/cassettes/test_calculate_order_line_unit.yaml
diff --git a/tests/plugins/plugins/cassettes/test_calculate_order_shipping.yaml b/tests/plugins/cassettes/test_calculate_order_shipping.yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_calculate_order_shipping.yaml
rename to tests/plugins/cassettes/test_calculate_order_shipping.yaml
diff --git a/tests/plugins/plugins/cassettes/test_get_cached_tax_codes_or_fetch.yaml b/tests/plugins/cassettes/test_get_cached_tax_codes_or_fetch.yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_get_cached_tax_codes_or_fetch.yaml
rename to tests/plugins/cassettes/test_get_cached_tax_codes_or_fetch.yaml
diff --git a/tests/plugins/plugins/cassettes/test_get_cached_tax_codes_or_fetch_wrong_response.yaml b/tests/plugins/cassettes/test_get_cached_tax_codes_or_fetch_wrong_response.yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_get_cached_tax_codes_or_fetch_wrong_response.yaml
rename to tests/plugins/cassettes/test_get_cached_tax_codes_or_fetch_wrong_response.yaml
diff --git a/tests/plugins/plugins/cassettes/test_plugin_uses_configuration_from_db.yaml b/tests/plugins/cassettes/test_plugin_uses_configuration_from_db.yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_plugin_uses_configuration_from_db.yaml
rename to tests/plugins/cassettes/test_plugin_uses_configuration_from_db.yaml
diff --git a/tests/plugins/plugins/cassettes/test_preprocess_order_creation.yaml b/tests/plugins/cassettes/test_preprocess_order_creation.yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_preprocess_order_creation.yaml
rename to tests/plugins/cassettes/test_preprocess_order_creation.yaml
diff --git a/tests/plugins/plugins/cassettes/test_preprocess_order_creation_wrong_data.yaml b/tests/plugins/cassettes/test_preprocess_order_creation_wrong_data.yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_preprocess_order_creation_wrong_data.yaml
rename to tests/plugins/cassettes/test_preprocess_order_creation_wrong_data.yaml
diff --git a/tests/plugins/plugins/cassettes/test_trigger_webhooks_for_event.yaml b/tests/plugins/cassettes/test_trigger_webhooks_for_event.yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_trigger_webhooks_for_event.yaml
rename to tests/plugins/cassettes/test_trigger_webhooks_for_event.yaml
diff --git a/tests/plugins/plugins/cassettes/test_trigger_webhooks_for_event_with_secret_key.yaml b/tests/plugins/cassettes/test_trigger_webhooks_for_event_with_secret_key.yaml
similarity index 100%
rename from tests/plugins/plugins/cassettes/test_trigger_webhooks_for_event_with_secret_key.yaml
rename to tests/plugins/cassettes/test_trigger_webhooks_for_event_with_secret_key.yaml
diff --git a/tests/plugins/conftest.py b/tests/plugins/conftest.py
index ce48d9a722..b2ab8de1fa 100644
--- a/tests/plugins/conftest.py
+++ b/tests/plugins/conftest.py
@@ -1,4 +1,6 @@
import pytest
+from django_prices_vatlayer.models import VAT
+from django_prices_vatlayer.utils import get_tax_for_rate
from saleor.plugins.base_plugin import ConfigurationTypeField
from saleor.plugins.models import PluginConfiguration
@@ -38,3 +40,66 @@ def new_config():
@pytest.fixture
def new_config_structure():
return {"type": ConfigurationTypeField.STRING, "help_text": "foo", "label": "foo"}
+
+
+def tax_rates():
+ return {
+ "standard_rate": 23,
+ "reduced_rates": {
+ "pharmaceuticals": 8,
+ "medical": 8,
+ "passenger transport": 8,
+ "newspapers": 8,
+ "hotels": 8,
+ "restaurants": 8,
+ "admission to cultural events": 8,
+ "admission to sporting events": 8,
+ "admission to entertainment events": 8,
+ "foodstuffs": 5,
+ },
+ }
+
+
+def taxes(tax_rates):
+ taxes = {
+ "standard": {
+ "value": tax_rates["standard_rate"],
+ "tax": get_tax_for_rate(tax_rates),
+ }
+ }
+ if tax_rates["reduced_rates"]:
+ taxes.update(
+ {
+ rate: {
+ "value": tax_rates["reduced_rates"][rate],
+ "tax": get_tax_for_rate(tax_rates, rate),
+ }
+ for rate in tax_rates["reduced_rates"]
+ }
+ )
+ return taxes
+
+
+def vatlayer(db, settings, tax_rates, taxes):
+ settings.VATLAYER_ACCESS_KEY = "enablevatlayer"
+ settings.PLUGINS = ["saleor.plugins.vatlayer.plugin.VatlayerPlugin"]
+ VAT.objects.create(country_code="PL", data=tax_rates)
+
+ tax_rates_2 = {
+ "standard_rate": 19,
+ "reduced_rates": {
+ "admission to cultural events": 7,
+ "admission to entertainment events": 7,
+ "books": 7,
+ "foodstuffs": 7,
+ "hotels": 7,
+ "medical": 7,
+ "newspapers": 7,
+ "passenger transport": 7,
+ },
+ }
+ VAT.objects.create(country_code="DE", data=tax_rates_2)
+ return taxes
diff --git a/tests/plugins/plugins/__init__.py b/tests/plugins/plugins/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/tests/plugins/plugins/conftest.py b/tests/plugins/plugins/conftest.py
deleted file mode 100644
index 677cb79003..0000000000
--- a/tests/plugins/plugins/conftest.py
+++ /dev/null
@@ -1,66 +0,0 @@
-import pytest
-from django_prices_vatlayer.models import VAT
-from django_prices_vatlayer.utils import get_tax_for_rate
-
-
-def tax_rates():
- return {
- "standard_rate": 23,
- "reduced_rates": {
- "pharmaceuticals": 8,
- "medical": 8,
- "passenger transport": 8,
- "newspapers": 8,
- "hotels": 8,
- "restaurants": 8,
- "admission to cultural events": 8,
- "admission to sporting events": 8,
- "admission to entertainment events": 8,
- "foodstuffs": 5,
- },
- }
-
-
-def taxes(tax_rates):
- taxes = {
- "standard": {
- "value": tax_rates["standard_rate"],
- "tax": get_tax_for_rate(tax_rates),
- }
- }
- if tax_rates["reduced_rates"]:
- taxes.update(
- {
- rate: {
- "value": tax_rates["reduced_rates"][rate],
- "tax": get_tax_for_rate(tax_rates, rate),
- }
- for rate in tax_rates["reduced_rates"]
- }
- )
- return taxes
-
-
-def vatlayer(db, settings, tax_rates, taxes):
- settings.VATLAYER_ACCESS_KEY = "enablevatlayer"
- settings.PLUGINS = ["saleor.plugins.vatlayer.plugin.VatlayerPlugin"]
- VAT.objects.create(country_code="PL", data=tax_rates)
-
- tax_rates_2 = {
- "standard_rate": 19,
- "reduced_rates": {
- "admission to cultural events": 7,
- "admission to entertainment events": 7,
- "books": 7,
- "foodstuffs": 7,
- "hotels": 7,
- "medical": 7,
- "newspapers": 7,
- "passenger transport": 7,
- },
- }
- VAT.objects.create(country_code="DE", data=tax_rates_2)
- return taxes
diff --git a/tests/plugins/plugins/test_avatax.py b/tests/plugins/test_avatax.py
similarity index 100%
rename from tests/plugins/plugins/test_avatax.py
rename to tests/plugins/test_avatax.py
diff --git a/tests/plugins/plugins/test_plugins.py b/tests/plugins/test_plugins.py
similarity index 100%
rename from tests/plugins/plugins/test_plugins.py
rename to tests/plugins/test_plugins.py
diff --git a/tests/plugins/plugins/test_vatlayer.py b/tests/plugins/test_vatlayer.py
similarity index 100%
rename from tests/plugins/plugins/test_vatlayer.py
rename to tests/plugins/test_vatlayer.py
diff --git a/tests/plugins/plugins/test_webhook.py b/tests/plugins/test_webhook.py
similarity index 100%
rename from tests/plugins/plugins/test_webhook.py
rename to tests/plugins/test_webhook.py