Add some tests

This commit is contained in:
Raphael Michel
2019-10-18 13:08:25 +02:00
parent a1c7a6f2b0
commit f8433b5cc9
10 changed files with 555 additions and 15 deletions

View File

@@ -1074,6 +1074,17 @@ class OrderTestCase(BaseQuotaTestCase):
self.event.settings.cancel_allow_user = False
assert not self.order.user_cancel_allowed
@classscope(attr='o')
def test_can_cancel_order_with_giftcard(self):
item1 = Item.objects.create(event=self.event, name="Ticket", default_price=23,
admission=True, allow_cancel=True, issue_giftcard=True)
p = OrderPosition.objects.create(order=self.order, item=item1,
variation=None, price=23)
self.event.organizer.issued_gift_cards.create(
currency="EUR", issued_in=p
)
assert not self.order.user_cancel_allowed
@classscope(attr='o')
def test_can_cancel_order_free(self):
self.order.status = Order.STATUS_PAID