Allow to create vouchers for *all* products (#1504)

This commit is contained in:
Raphael Michel
2019-11-27 14:57:09 +01:00
committed by GitHub
parent 530632d624
commit bbc70447a2
7 changed files with 32 additions and 15 deletions

View File

@@ -717,6 +717,14 @@ class VoucherTestCase(BaseQuotaTestCase):
self.assertTrue(v.applies_to(self.var1.item, self.var1))
self.assertFalse(v.applies_to(self.var1.item, self.var2))
@classscope(attr='o')
def test_voucher_applicability_all(self):
v = Voucher.objects.create(event=self.event)
self.assertTrue(v.applies_to(self.item1))
self.assertTrue(v.applies_to(self.var1.item))
self.assertTrue(v.applies_to(self.var1.item, self.var1))
self.assertTrue(v.applies_to(self.var1.item, self.var2))
@classscope(attr='o')
def test_voucher_applicability_variation_through_quota(self):
self.quota.variations.add(self.var1)