Gift cards: Improved support for cross-organizer acceptance (#3311)

Co-authored-by: Martin Gross <martin@pc-coholic.de>
This commit is contained in:
Raphael Michel
2023-06-15 14:17:40 +02:00
committed by GitHub
parent b3c917925c
commit f8be8296dd
22 changed files with 605 additions and 139 deletions

View File

@@ -293,6 +293,19 @@ def test_giftcard_transact_cross_organizer(token_client, organizer, event, other
assert other_giftcard.transactions.last().acceptor == organizer
@pytest.mark.django_db
def test_giftcard_transact_cross_organizer_inactive(token_client, organizer, event, other_giftcard):
organizer.gift_card_issuer_acceptance.update(active=False)
resp = token_client.post(
'/api/v1/organizers/{}/giftcards/{}/transact/?include_accepted=true'.format(organizer.slug, other_giftcard.pk),
{
'value': '10.00',
},
format='json'
)
assert resp.status_code == 404
@pytest.mark.django_db
def test_giftcard_transact_min_zero(token_client, organizer, event, giftcard):
resp = token_client.post(