Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

applicator_tests.py 628B

12345678910111213141516171819202122
  1. from decimal import Decimal as D
  2. from django.test import TestCase
  3. from oscar.apps.offer.results import OfferApplications
  4. from oscar.apps.offer import models
  5. class TestOfferApplicationsWrapper(TestCase):
  6. def setUp(self):
  7. offer = models.ConditionalOffer()
  8. self.applications = OfferApplications()
  9. for i in range(4):
  10. self.applications.add(offer, models.BasketDiscount(D('5.00')))
  11. def test_is_iterable(self):
  12. for discount in self.applications:
  13. pass
  14. def test_aggregates_results_from_same_offer(self):
  15. self.assertEqual(1, len(list(self.applications)))