Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Test passing taxes to get_availability
Rafał Pitoń9927d67aca72
diff --git a/saleor/settings.py b/saleor/settings.pyindex a79825e9bb..3de609dc3f 100644--- a/saleor/settings.py+++ b/saleor/settings.py@@ -281,8 +281,8 @@ OPENEXCHANGERATES_API_KEY = os.environ.get('OPENEXCHANGERATES_API_KEY')# VAT configuration# Enabling vat requires valid vatlayer access key. By default prices entered in-# dashboard are treated as net amounts. If you wish to reverse that and use-# them as gross amounts instead change the BASE_PRICES_ARE_NET to False+# dashboard are treated as gross amounts. If you wish to reverse that and use+# them as net amounts change the INCLUDE_TAXES_IN_PRICES to FalseVATLAYER_ACCESS_KEY = os.environ.get('VATLAYER_ACCESS_KEY')INCLUDE_TAXES_IN_PRICES = Truediff --git a/tests/test_product_availability.py b/tests/test_product_availability.pyindex 2d7daa09d8..dd1575bc83 100644--- a/tests/test_product_availability.py+++ b/tests/test_product_availability.py@@ -68,10 +68,11 @@ def test_variant_availability_status(unavailable_product):status = get_variant_availability_status(variant)-def test_availability(product, monkeypatch, settings):+def test_availability(product, monkeypatch, settings, taxes):availability = get_availability(product)assert availability.price_range == product.get_price_range()assert availability.price_range_local_currency is None+monkeypatch.setattr('django_prices_openexchangerates.models.get_rates',lambda c: {'PLN': Mock(rate=2)})@@ -81,6 +82,13 @@ def test_availability(product, monkeypatch, settings):assert availability.price_range_local_currency.start.currency == 'PLN'assert availability.available+ availability = get_availability(product, taxes=taxes)+ assert availability.price_range.start.tax.amount+ assert availability.price_range.stop.tax.amount+ assert availability.price_range_undiscounted.start.tax.amount+ assert availability.price_range_undiscounted.stop.tax.amount+ assert availability.available+def test_available_products_only_published(product_list):available_products = models.Product.objects.available_products()