def setUp(self): range = models.Range.objects.create(name="All products", includes_all_products=True) self.condition = models.CountCondition(range=range, type=models.Condition.COUNT, value=2) self.benefit = models.PercentageDiscountBenefit( range=range, type=models.Benefit.PERCENTAGE, value=20) self.offer = mock.Mock() self.basket = factories.create_basket(empty=True)
def setUp(self): range = models.Range(name="All products", includes_all_products=True) condition = models.CountCondition(range=range, type=models.Condition.COUNT, value=3) benefit = models.PercentageDiscountBenefit( range=range, type=models.Benefit.PERCENTAGE, value=20, max_affected_items=1) self.offer = models.ConditionalOffer( name="Test", offer_type=models.ConditionalOffer.SITE, condition=condition, benefit=benefit)
def setUp(self): range = models.Range.objects.create(name="All products", includes_all_products=True) self.condition = models.CountCondition(range=range, type=models.Condition.COUNT, value=2) self.benefit = models.PercentageDiscountBenefit( range=range, type=models.Benefit.PERCENTAGE, value=20, max_affected_items=1) self.offer = models.ConditionalOffer( offer_type=models.ConditionalOffer.SITE, condition=self.condition, benefit=self.benefit) self.basket = factories.create_basket(empty=True)