def test_calculate_R4_5kg(self): define_recommanded_level('R1') shipper = self._create_cart([('5', 'kg', 1)]) self.assertEqual(shipper.cost(), Decimal('13.45')) self._assertIsColissimo(shipper, True) self.assertEqual(shipper.description(), u'5 Kg - France - Monaco - Andore')
def test_calculate_R1_letter(self): define_recommanded_level('R1') #No impact: this setting is only for colissimo shipper = self._create_cart([('0.5', 'kg', 1)]) self.assertEqual(shipper.cost(), Decimal('4.9')) self._assertIsColissimo(shipper, False) self.assertEqual(shipper.description(), u'0.5 Kg')
def test_calculate_invalid_recommanded_level(self): define_recommanded_level('???') shipper = self._create_cart([('0.51', 'kg', 1)]) self.assertEqual(shipper.cost(), Decimal('6.95')) #By default R0 self._assertIsColissimo(shipper, True) self.assertEqual(shipper.description(), u'1 Kg - France - Monaco - Andore')
def setUp(self): define_recommanded_level('R0') define_default_product_weight('0.05')