mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Cart: ensure free price input is decimal (PRETIXEU-80N)
Co-authored-by: Phin Wolkwitz <wolkwitz@rami.io>
This commit is contained in:
committed by
GitHub
parent
5ad0f92776
commit
e9b22b7d33
@@ -23,6 +23,7 @@ import json
|
||||
from decimal import Decimal
|
||||
|
||||
import pytest
|
||||
from django.utils import translation
|
||||
from django.utils.timezone import now
|
||||
from django_countries.fields import Country
|
||||
|
||||
@@ -196,7 +197,8 @@ def test_free_price_accepted(item):
|
||||
@pytest.mark.django_db
|
||||
def test_free_price_string(item):
|
||||
item.free_price = True
|
||||
assert get_price(item, custom_price='42,00').gross == Decimal('42.00')
|
||||
with translation.override('de'):
|
||||
assert get_price(item, custom_price='42,00').gross == Decimal('42.00')
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@@ -209,7 +211,7 @@ def test_free_price_float(item):
|
||||
def test_free_price_limit(item):
|
||||
item.free_price = True
|
||||
with pytest.raises(ValueError):
|
||||
get_price(item, custom_price=Decimal('200000000'))
|
||||
get_price(item, custom_price=Decimal('200000000000'))
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
|
||||
Reference in New Issue
Block a user