Example #1
0
class TestOfferApplicationsWrapper(TestCase):
    def setUp(self):
        offer = models.ConditionalOffer()
        self.applications = OfferApplications()
        for i in range(4):
            self.applications.add(offer, models.BasketDiscount(D('5.00')))

    def test_is_iterable(self):
        for discount in self.applications:
            pass

    def test_aggregates_results_from_same_offer(self):
        self.assertEqual(1, len(list(self.applications)))
class TestOfferApplicationsWrapper(TestCase):

    def setUp(self):
        offer = models.ConditionalOffer()
        self.applications = OfferApplications()
        for i in range(4):
            self.applications.add(offer, models.BasketDiscount(D('5.00')))

    def test_is_iterable(self):
        for discount in self.applications:
            pass

    def test_aggregates_results_from_same_offer(self):
        self.assertEqual(1, len(list(self.applications)))
Example #3
0
 def setUp(self):
     offer = models.ConditionalOffer()
     self.applications = OfferApplications()
     for i in range(4):
         self.applications.add(offer, models.BasketDiscount(D('5.00')))
 def setUp(self):
     offer = models.ConditionalOffer()
     self.applications = OfferApplications()
     for i in range(4):
         self.applications.add(offer, models.BasketDiscount(D('5.00')))