Esempio n. 1
0
def make_tiers(carrier, prices, expires=None):
    for min_total, price in prices:
        t = ShippingTier(carrier=carrier,
                         min_total=Decimal("%i.00" % min_total),
                         price=Decimal("%i.00" % price),
                         expires=expires)
        t.save()
Esempio n. 2
0
def make_tiers(carrier, prices, expires=None):
    for min_total, price in prices:
        t = ShippingTier(carrier=carrier, 
            min_total=Decimal("%i.00" % min_total),
            price=Decimal("%i.00" % price),
            expires=expires
        )
        t.save()
Esempio n. 3
0
 def setUp(self):
     self.carrier = Carrier(name="pricing", active=True)
     self.carrier.save()
     t = ShippingTier(carrier=self.carrier, 
         min_total=Decimal("0.00"),
         price=Decimal("10.00"),
         )
     t.save()
Esempio n. 4
0
 def setUp(self):
     self.carrier = Carrier(name="pricing", active=True)
     self.carrier.save()
     t = ShippingTier(carrier=self.carrier, 
         min_total=Decimal("0.00"),
         price=Decimal("10.00"),
         )
     t.save()
Esempio n. 5
0
 def test2Prices(self):
     t = ShippingTier(carrier=self.carrier, 
         min_total=Decimal("20.00"),
         price=Decimal("15.00"),
         )
     t.save()
     
     self.assertEqual(self.carrier.price(Decimal("0.00")), Decimal("10.00"))
     self.assertEqual(self.carrier.price(Decimal("20.00")), Decimal("15.00"))
Esempio n. 6
0
 def test2Prices(self):
     t = ShippingTier(carrier=self.carrier, 
         min_total=Decimal("20.00"),
         price=Decimal("15.00"),
         )
     t.save()
     
     self.assertEqual(self.carrier.price(Decimal("0.00")), Decimal("10.00"))
     self.assertEqual(self.carrier.price(Decimal("20.00")), Decimal("15.00"))
Esempio n. 7
0
 def testCreate(self):
     c = Carrier(key="test", active=True)
     c.save()
     t = ShippingTier(carrier=c, 
         min_total=Decimal("0.00"),
         price=Decimal("10.00"),
         )
     t.save()
     
     self.assertEqual(c.price(Decimal("0.00")), Decimal("10.00"))
Esempio n. 8
0
 def testCreate(self):
     c = Carrier(key="test", active=True)
     c.save()
     t = ShippingTier(carrier=c, 
         min_total=Decimal("0.00"),
         price=Decimal("10.00"),
         )
     t.save()
     
     self.assertEqual(c.price(Decimal("0.00")), Decimal("10.00"))