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
+3 -3
View File
@@ -971,7 +971,7 @@ class GiftCardPayment(BasePaymentProvider):
messages.error(request, _("This gift card can only be used in test mode."))
return
if not gc.testmode and self.event.testmode:
messages.error(request, _("Only test gifts cards can be used in test mode."))
messages.error(request, _("Only test gift cards can be used in test mode."))
return
if gc.value <= Decimal("0.00"):
messages.error(request, _("All credit on this gift card has been used."))
@@ -1017,10 +1017,10 @@ class GiftCardPayment(BasePaymentProvider):
if gc.currency != self.event.currency:
messages.error(request, _("This gift card does not support this currency."))
return
if gc.testmode and not self.event.testmode:
if gc.testmode and not payment.order.testmode:
messages.error(request, _("This gift card can only be used in test mode."))
return
if not gc.testmode and self.event.testmode:
if not gc.testmode and payment.order.testmode:
messages.error(request, _("Only test gift cards can be used in test mode."))
return
if gc.value <= Decimal("0.00"):