Deal with cancelling memberships (#2130)

This commit is contained in:
Raphael Michel
2021-06-17 18:10:45 +02:00
committed by GitHub
parent 8ad53256c2
commit 1ef076bb9b
13 changed files with 153 additions and 2 deletions

View File

@@ -227,6 +227,27 @@ def test_validate_membership_ensure_locking(event, customer, membership, requiri
assert any('FOR UPDATE' in s['sql'] for s in captured)
@pytest.mark.django_db
def test_validate_membership_canceled(event, customer, membership, requiring_ticket, membership_type):
with pytest.raises(ValidationError) as excinfo:
membership.canceled = True
membership.save()
validate_memberships_in_order(
customer,
[
CartPosition(
item=requiring_ticket,
used_membership=membership
)
],
event,
lock=False,
ignored_order=None,
testmode=False,
)
assert "canceled" in str(excinfo.value)
@pytest.mark.django_db
def test_validate_membership_test_mode(event, customer, membership, requiring_ticket, membership_type):
with pytest.raises(ValidationError) as excinfo: