Skip to content

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

Fix failing tests

Anna Siwik85d371e1f22f
diff --git a/saleor/discount/models.py b/saleor/discount/models.py
index 5c29b0ed87..6d19a7b174 100644
--- a/saleor/discount/models.py
+++ b/saleor/discount/models.py
@@ -56,8 +56,7 @@ class Voucher(models.Model):
'product.Product', blank=True, null=True, on_delete=models.CASCADE)
category = models.ForeignKey(
'product.Category', blank=True, null=True, on_delete=models.CASCADE)
- apply_to = models.CharField(
- max_length=20, blank=True, null=True)
+ apply_to = models.CharField(max_length=20, blank=True, null=True)
limit = PriceField(
max_digits=12, decimal_places=2, null=True, blank=True,
currency=settings.DEFAULT_CURRENCY)
diff --git a/tests/test_discounts.py b/tests/test_discounts.py
index 9f0fb5f69b..a5816cb73c 100644
--- a/tests/test_discounts.py
+++ b/tests/test_discounts.py
@@ -340,8 +340,8 @@ def test_get_category_variants_and_prices_product_with_many_categories(
def test_increase_voucher_usage():
voucher = Voucher.objects.create(
- code='unique', type=Voucher.VALUE_TYPE,
- discount_value_type=Voucher.DISCOUNT_VALUE_FIXED,
+ code='unique', type=VoucherType.VALUE,
+ discount_value_type=DiscountValueType.FIXED,
discount_value=10, usage_limit=100)
increase_voucher_usage(voucher)
voucher.refresh_from_db()
@@ -350,8 +350,8 @@ def test_increase_voucher_usage():
def test_decrease_voucher_usage():
voucher = Voucher.objects.create(
- code='unique', type=Voucher.VALUE_TYPE,
- discount_value_type=Voucher.DISCOUNT_VALUE_FIXED,
+ code='unique', type=VoucherType.VALUE,
+ discount_value_type=VoucherType.VALUE,
discount_value=10, usage_limit=100, used=10)
decrease_voucher_usage(voucher)
voucher.refresh_from_db()