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.

test_results.py 1.0KB

123456789101112131415161718192021222324252627282930
  1. from decimal import Decimal as D
  2. from django.test import TestCase
  3. from oscar.apps.offer import models, results
  4. class TestOfferApplicationsObject(TestCase):
  5. def setUp(self):
  6. self.applications = results.OfferApplications()
  7. self.offer = models.ConditionalOffer()
  8. def test_is_countable(self):
  9. self.assertEqual(0, len(self.applications))
  10. def test_can_filter_shipping_discounts(self):
  11. result = models.ShippingDiscount()
  12. self.applications.add(self.offer, result)
  13. self.assertEqual(1, len(self.applications.shipping_discounts))
  14. def test_can_filter_offer_discounts(self):
  15. result = models.BasketDiscount(D('2.00'))
  16. self.applications.add(self.offer, result)
  17. self.assertEqual(1, len(self.applications.offer_discounts))
  18. def test_can_filter_post_order_actions(self):
  19. result = models.PostOrderAction("Something will happen")
  20. self.applications.add(self.offer, result)
  21. self.assertEqual(1, len(self.applications.post_order_actions))